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.
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.