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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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