Hi everyone. Is there any way I can get a dataset with a column that has a number that varies row by row (which is a series of dates in the year), to display a total number today, and for each date (let's say there is a date for each week) the 'total' number decreases.
I cannot get the SUM to mathematically work out at all and this is driving me nuts. So in the spreadsheet I have used as an example, I have column A & B in the dataset already loaded in VA. How inside VA do I create column C?
I need to do it in VA to keep the data 'dynamic'. If I 'hard code it' in a spreadsheet and load it to VA, that will defeat the purpose of the report I am trying to create.
Thanks in advance.
I have never worked with SAS VA, but if you can run basic sas then:
1) sort your data by descending date.
2) run a step like:
data temp;
set have;
retain total 0;
total + var_to_sum;
run;
3) sort your data by date (ascending is the default).
Thanks Shmuel, I know that will work in SAS EG, but unfortunately it won't work in VA. Appreciate your assistance.
Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.
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.