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

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