Hi All,
My data looks like this
ID '28-Feb-14'n ...'28-Feb-16'n Policy_Start
101 90.20 ..... 30.89 21JAN2014
102 76.90 ....... 45.67 13MAR2015
103 66.66 ...... 67.45 20JUN2015
i need to add up all the columns which are less than this formula
New_Column=(sum(all_columns_which are less than policy_start+365 )<(policy_start+365))
please kindly note all the columns names are with date.
So how i refer only those columns to sum up .
Please revert asap.
Thanks,
Vamsi.
Question: what about leap years? Do you really want policy_start+365, or do you want INTNX('year',policy_start,1,'s')? (look it up).
pseudo-code:
Transpose your data to a long format makes this much easier.
Dates shouldn't be variable names - you're storing information in your variable names.
This is fine for reporting but not great for data analysis.
It's harder to develop dynamic processes around variable names that constantly change and the number of variables will also change. And when adding data you have to add new columns instead of rows.
Can you change your data to a long format for analysis and then transpose for reporting?
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.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.