In SAS-VA 7.4 I need to add values of 12 months and present them by four months, but with some conditions:
1. I cannot use parameters, as the results must be calculated and presented every four months on all records in the database;
2. In a universe of several items, I must separate 2 items and add them, but each item has a different sum shape. Each quarter corresponds to the sum of 12 months.
Item 1
- 1st Quarter of the year considered (e.g. from 5/1/2018 to 4/30/2019): I must add only the values corresponding to the months of 2019;
- 2nd Quarter of the year considered (e.g. 9/1/2018 to 8/31/2019): I must add only the values corresponding to the months of the year 2019 (same rule as the 1st Quarter).
- 3rd Quarter of the year considered (e.g. 1/1/2019 to 12/31/2019): I must consider the value of January of the following year. In the example above, the value for the 3rd quarter will be January 2020.
Item 2
- For calculation in any quarter, we consider the sum of the values of each month - e.g.: 2nd Quarter of 2019: I must add the values from September 2018 to August 2019.
The value to be displayed will be the sum of items 1 and 2.
The sum of Item 1 I can do with the RelativePeriod or CumulativePeriod function, but the sum of item 2 I can't do.
Please ask anyone who can help me.
Sorry, I made a mistake - my question is this: the sum of Item 2 I can do with the RelativePeriod or CumulativePeriod function, but the sum of item 1 I can't do.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.