BookmarkSubscribeRSS Feed
Frank_Boekamp
Quartz | Level 8

Is it possible to define aggregated measures in computed columns using proc imstat?

 

I did not find a lot of documentation on computed columns in proc imstat. Following paper did supply a bit of info:

 

https://support.sas.com/resources/papers/proceedings15/SAS1905-2015.pdf

 

COMPUTED COLUMNS Using computed columns at data load time offers a couple of key advantages.  First, computed columns are virtual and exist as code that executes when the table is accessed. In effect, this does not increase your data footprint in HDFS or in the data warehouse.  Second, using computed columns in this way may provide you more flexibility in changing the calculation(s) if and when business rules change.  Use PROC IMSTAT to add a permanent computed column to an in-memory table:   

 

proc imstat;      

table lasr.cars;      

compute computed1 "computed1=mpg_city/mpg_highway";      

run;   

quit;
 
It is worth noting that adding calculated columns at load time presents all users with the same calculation and report designers do not need to calculate the measures for every report.

 

1 REPLY 1
MikeMcKiernan
SAS Employee

Row-wise operations can be performed, similar to the ratio example that you showed.

 

compute sum1 "sum1=sum(mpg_city, mpg_highway)";

compute weird1 "weird1=min(weight, (enginesize * cylinders * horsepower * 2));";

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!

Tips for filtering data sources in SAS Visual Analytics

See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 949 views
  • 2 likes
  • 2 in conversation