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
Super User
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
Super User

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

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

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