Hi Cynthia,
Thank you! It works fine for me, one more question if you don't mind. I got my table from transposing another table. Hence the column name is not static, for example it can be profit_march, profit_april, profit_may instead of profit_january, profit_february, profit_may depending on the given parameter.
If that is the case how do I define the Column?
Thanks!
If you transposed from a data set that had month as a variable you might be better off to go back to that and use month with a label of "Profit" as a column header. Sort order would probably be best to have month as the number of month and use a custom format to display the month's name so order=internal.
Or if you had actual date values use an appropriate format for a date.
Then you don't have to worry about changing numbers of months and adjusting a list of variables.
COLUMN Company ('Profit' profit_: );
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.