Exploring, predicting and reporting with SAS Visual Analytics and SAS Visual Statistics

SAS VA 7.1 - decreasing sum

Reply
New Contributor
Posts: 4

SAS VA 7.1 - decreasing sum

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.

Trusted Advisor
Posts: 1,848

Re: SAS VA 7.1 - decreasing sum

Posted in reply to critters187

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

 

 

 

New Contributor
Posts: 4

Re: SAS VA 7.1 - decreasing sum

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

Ask a Question
Discussion stats
  • 2 replies
  • 193 views
  • 0 likes
  • 2 in conversation