BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
NickyM
Calcite | Level 5

Hi,

 

I'm trying to do a 'Year over Year Growth' calculation in SAS Visual Analytics, using a date variable called 'peildatum' and a measure called 'Aantal spelers'. It keeps returning missing values and I have no Idea why. (see screenshot)

Could anyone tell me what could be a reason for this problem?

 

Thanks! 

Nicky

1 ACCEPTED SOLUTION

Accepted Solutions
Sam_SAS
SAS Employee

Hi Nicky,

 

I believe the problem is that your date data item has the DDMMYYYY (or MMDDYYYY) format.

 

Details:

 

Spoiler

 

This is causing the aggregation to infer a daily time interval for periodic calculations, which returns missing for the ParallelPeriod operator (used by YOY Growth.) A daily interval is OK sometimes, however. 
See the bulleted list here: https://support.sas.com/documentation/cdl/en/vaug/69957/HTML/default/viewer.htm#n1lxnqfip132can1hdzu...

 

 

There are two ways to address the issue:

 

1. Edit the expression to change each instance of _Inferred_ to _ByMonth_ (or any value other than _Inferred_)

 

2. Delete the YOY calculation, then change the format of Peildatum to "Year", then create YOY Growth again.

 

Either of these approaches should work.

 

Hope that helps,

Sam

View solution in original post

8 REPLIES 8
Sam_SAS
SAS Employee

Hi Nicky,

 

I don't see your screenshot.

 

Period calculations like YOY will return missing if your report object uses a different date variable than the one that the calculation is based on. Could that be the issue?

 

Did you create Year over Year Growth automatically from the Data panel, or did you build the expression manually? That would help rule out some other possibilities.

 

Thanks,

Sam

NickyM
Calcite | Level 5

Hi,

 

Thanks for your reply. I created YOY automatically. I tried to do it manually but I didn't really know the right way to do it.

 

I hope you can see my screenshot now.

 

 

YOY.PNG

Sam_SAS
SAS Employee

I can see the screenshot now, thanks. Today is a holiday in the US but I will look into it tomorrow.

 

Thanks,

Sam

Sam_SAS
SAS Employee
Hi Nicky,

Can you post the expression for your YOY aggregated measure?

Right-click the item in the Data pane and select Edit. Then, in the expression editor, select the Text tab.

You will see an expression like this:

( ParallelPeriod(_Sum_, 'Facility Employees'n, 'Transaction Year'n, _Inferred_, _ByYear_, 0, _ToToday_, {Date}) - ParallelPeriod(_Sum_, 'Facility Employees'n, 'Transaction Year'n, _Inferred_, _ByYear_, -1, _ToToday_, {Date}) ) / Abs(ParallelPeriod(_Sum_, 'Facility Employees'n, 'Transaction Year'n, _Inferred_, _ByYear_, -1, _ToToday_, {Date}))

That will help me to troubleshoot.

Thanks,
Sam
NickyM
Calcite | Level 5

Hi,

 

Thanks for looking into it. 

Here's the code:

 

( ParallelPeriod(_Sum_, 'Aantal spelers'n, 'Peildatum'n, _Inferred_, _ByYear_, 0, _ToToday_, {Date}) - ParallelPeriod(_Sum_, 'Aantal spelers'n, 'Peildatum'n, _Inferred_, _ByYear_, -1, _ToToday_, {Date}) ) / Abs(ParallelPeriod(_Sum_, 'Aantal spelers'n, 'Peildatum'n, _Inferred_, _ByYear_, -1, _ToToday_, {Date}))

 

Hope you can find out what's wrong. I tried using YOY in several reports but it never works. Neither do other 'Create and add' calculations. 

 

Thanks! 

Nicky

Sam_SAS
SAS Employee

Hi Nicky,

 

I believe the problem is that your date data item has the DDMMYYYY (or MMDDYYYY) format.

 

Details:

 

Spoiler

 

This is causing the aggregation to infer a daily time interval for periodic calculations, which returns missing for the ParallelPeriod operator (used by YOY Growth.) A daily interval is OK sometimes, however. 
See the bulleted list here: https://support.sas.com/documentation/cdl/en/vaug/69957/HTML/default/viewer.htm#n1lxnqfip132can1hdzu...

 

 

There are two ways to address the issue:

 

1. Edit the expression to change each instance of _Inferred_ to _ByMonth_ (or any value other than _Inferred_)

 

2. Delete the YOY calculation, then change the format of Peildatum to "Year", then create YOY Growth again.

 

Either of these approaches should work.

 

Hope that helps,

Sam

NickyM
Calcite | Level 5

Hi, 

 

It works!

 

Thanks a lot,

Nicky

 

 

Sam_SAS
SAS Employee

Great to hear it Nicky! Thanks for following up with us. Man Happy

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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
  • 8 replies
  • 2594 views
  • 0 likes
  • 2 in conversation