BookmarkSubscribeRSS Feed
Sarinka
Calcite | Level 5

Hi all,

 

I made a table using proc mean as below for all stats.

 

dteDeprtMetricMINMax
2019-08-31ASave rateXXyy
2019-09-30ASave rateXXyy
2019-10-31ASave rateXXyy
2019-08-31BClose rateXXyy
2019-09-30BClose rateXXyy
2019-10-31BClose rateXXyy

 

however need to transpose it to smaller report with variance as delta and  for specific dates (dte) only and with dates across , like below.

 

   dtedte 
DeprtMetric 2019-10-312019-09-30Delta
ASave rateMINxxyyzz
ASave rateMaxxxyyzz
      
BClose rateMINxxyyzz
BClose rateMaxxxyyzz

 

Any idea how to do it in simple way? I can use transpose but may be there is another way?

 

thanks

 

2 REPLIES 2
ballardw
Super User

First, define how "delta" is to be calculated.

 

Second, does this need to be a data set (used for further analysis) or a report (people read these)?

 

Best to provide example starting data is to use Instructions here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the {i} icon or attached as text to show exactly what you have and that we can test code against.

Sarinka
Calcite | Level 5

Thank you,

delta is one minus another and It will be report.

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 465 views
  • 0 likes
  • 2 in conversation