BookmarkSubscribeRSS Feed
Nmah
Calcite | Level 5

 

Hi,

 

I am trying to calculate % change in monthly "Write off amount" in my data. To do this, I am using the periodic aggregation as below:

 

{Periodic aggregate (Current month) - Relative Period Aggregate (previous month)}/ Relative Period aggregate (previous month).

My queries:

 

1. The formula for current month's aggregate works fine if I use "_Inferred_" as the interval for period. But it returns a missing value if I use "_ByMonth_". "Period" is a date variable formatted as monyy. Screenshot attached.

2. The same formula does not work for "Relative Period" aggregation. So if I use "Relative Period" aggregation, it returns a missing value while using "_Inferred_" or "_ByMonth_". Hence unable to output any percentage change. Screenshot attached.

 

Note: Variable "Period" is SAS date variable (includes year) formatted as monyy.

 

Please can someone help me understand where is the problem and why is one function working fine whereas another similar function is not.

 

 SASVA_1.PNG

2 REPLIES 2
ballardw
Super User

Doesn't work is awful vague.

Are there errors in the log?: Post the code and log in a code box opened with the {i} to maintain formatting of error messages.

No output? Post any log in a code box.

Unexpected output? Provide some example input data, preferably in the form of data step code pasted into a code box, the actual results and the expected results.

Nmah
Calcite | Level 5

 

Thanks for your reply..

 

 

It does not give an error just returns a missing value that's why I am unable to interpret.

 

But I think I have come to an understanding that this is because I am using the periodic aggregation in a "List Table" where "period" is not a data object in the table although it is being used as a dropdown control to display different months.

 

Hence the formula is working fine on my other tables which are "Cross tabs" and have "Period" as a data object in the report/visualisation.

 

Hence closing the thread.

 

Thanks again!

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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