BookmarkSubscribeRSS Feed
critters187
Calcite | Level 5

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.

2 REPLIES 2
Shmuel
Garnet | Level 18

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).   

 

 

 

critters187
Calcite | Level 5

Thanks Shmuel, I know that will work in SAS EG, but unfortunately it won't work in VA.  Appreciate your assistance.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 2 replies
  • 757 views
  • 0 likes
  • 2 in conversation