BookmarkSubscribeRSS Feed
obertel
Fluorite | Level 6

Hi

 

I'm struggling with a simple task. Having one category (year/month) and two measures, I want to create a report with year/month in the columns and the two measures in the rows.

 

Default the list table object looks like this:

 

               Measure1     Measure2           

2017-jan             10           20

2017-feb             15           10

2017-mar             11           12

2017-...

 

The requirement is to swap the rows and columns to get this result:

 

           2017-jan   2017-feb   2017-mar   2017-...

Measure1         10         15         11

Measure2         20         10         12

 

I have already looked into crosstab but it doesn't seem to give the required result.

 

I'm using SAS Visual Analytics 7.3.

 

Any suggestions?

 

Thanks

 

/Ole

4 REPLIES 4
PeterClemmensen
Tourmaline | Level 20
data have;
input date$ Measure1 Measure2;
datalines; 
2017jan 10 20
2017feb 15 10
2017mar 11 12
;

proc transpose data=have out=want(rename=(_name_=Measure));
	id date;
run;
obertel
Fluorite | Level 6

Hi draycut

 

Thanks for your fast reply.

 

I'm looking for a solution within VA, without SAS programming. Is it possible?

 

/Ole

PeterClemmensen
Tourmaline | Level 20

Ok. I'm no VA expert, but my best guess is the Pivot By Feature . 

 

If that doesn't work for you, there is a Visual Analytics Community on here where you can post your question or search for related threads 🙂

SteffenBille
SAS Employee

Hi Ole.

You are not the first to struggle with this issue, but this cannot be done directly in VA Designer / Explorer 7.3, but it can be done in VA 8.2. See more at https://www.sas.com/va

If you want this, then you need to prepare your data before VA, just like the other answer suggested. Either in SAS og VA data builder.

/ Steffen

 

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

Discussion stats
  • 4 replies
  • 1450 views
  • 3 likes
  • 3 in conversation