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

derived types for measures for diff in yesterdays sales - 2 days ago sales

Reply
Contributor
Posts: 59

derived types for measures for diff in yesterdays sales - 2 days ago sales

va 7.3

i am pulling sales from a data source that contains a date and sales amount.

i want to show the sales from yesterday with increase/descrease amount over the prior week/same day sales amount

 

ex.  today is 06.15

i will show sales for 06.14 (tuesday) compared to sales 06.07 (tuesday).

 

trying to use derived item but no luck making this work.

month works cannot get the calculation to work with a day.

 

using inferred  and -7 on the previous side of the calculation.

Frequent Contributor
Posts: 142

Re: derived types for measures for diff in yesterdays sales - 2 days ago sales

Hi mhamlett,

Have you tried to use the intck function?

data test;
days=intck('day','10jan16'd,'01jul16'd);
put days;
run;

With this function you can specify days, months, weeks... Using this function should be easy identify the dates comparing with actual day.

 

I usually take the actual day with 

%let today	=	%qsysfunc(date(),yymmdd10.);

 

Contributor
Posts: 59

Re: derived types for measures for diff in yesterdays sales - 2 days ago sales

sorry, but what you are suggesting does not exist in the VA product under creating a calculated measure or aggregated measure.
Frequent Contributor
Posts: 112

Re: derived types for measures for diff in yesterdays sales - 2 days ago sales

If you want to do that in SAS VA - just use the TreatAs function.

 

Try this post for some specific guidance:

https://communities.sas.com/t5/SAS-Visual-Analytics/Finding-No-of-Days-between-two-dates-in-SAS-VA/m...

 

 


Tricia Aanderud
Zencos Consulting
Twitter: @taanderud - Follow me!

Post a Question
Discussion Stats
  • 3 replies
  • 194 views
  • 0 likes
  • 3 in conversation