BookmarkSubscribeRSS Feed
acordes
Rhodochrosite | Level 12

I want to aggregate for the upcoming next 12 months, so the calendar year shouldn't impact at all.

My first choice was the periodic cumulative measure but I cannot sum over the next 12 months. This goes against my understanding what this measure promises to do.

My workaround is to sum relative periods (0 to 11 by 1). This works but feels complicated.

 

Here comes the code for the aggregated measure outlook 12 months that fulfills the task. 

 

CumulativePeriod(_Sum_, 'Frequency'n, _IgnoreAllTimeFrameFilters_
, '_FECULVTO'n, _ByMonth_, _ByMonth_, 1, 1, _Full_, {Date}) +
CumulativePeriod(_Sum_, 'Frequency'n, _IgnoreAllTimeFrameFilters_
, '_FECULVTO'n, _ByMonth_, _ByMonth_, 2, 1, _Full_, {Date}) +
CumulativePeriod(_Sum_, 'Frequency'n, _IgnoreAllTimeFrameFilters_
, '_FECULVTO'n, _ByMonth_, _ByMonth_, 3, 1, _Full_, {Date}) +
CumulativePeriod(_Sum_, 'Frequency'n, _IgnoreAllTimeFrameFilters_
, '_FECULVTO'n, _ByMonth_, _ByMonth_, 4, 1, _Full_, {Date}) +
CumulativePeriod(_Sum_, 'Frequency'n, _IgnoreAllTimeFrameFilters_
, '_FECULVTO'n, _ByMonth_, _ByMonth_, 5, 1, _Full_, {Date}) +
CumulativePeriod(_Sum_, 'Frequency'n, _IgnoreAllTimeFrameFilters_
, '_FECULVTO'n, _ByMonth_, _ByMonth_, 6, 1, _Full_, {Date}) +
CumulativePeriod(_Sum_, 'Frequency'n, _IgnoreAllTimeFrameFilters_
, '_FECULVTO'n, _ByMonth_, _ByMonth_, 7, 1, _Full_, {Date}) +
CumulativePeriod(_Sum_, 'Frequency'n, _IgnoreAllTimeFrameFilters_
, '_FECULVTO'n, _ByMonth_, _ByMonth_, 8, 1, _Full_, {Date}) +
CumulativePeriod(_Sum_, 'Frequency'n, _IgnoreAllTimeFrameFilters_
, '_FECULVTO'n, _ByMonth_, _ByMonth_, 9, 1, _Full_, {Date}) +
CumulativePeriod(_Sum_, 'Frequency'n, _IgnoreAllTimeFrameFilters_
, '_FECULVTO'n, _ByMonth_, _ByMonth_, 10, 1, _Full_, {Date}) +
CumulativePeriod(_Sum_, 'Frequency'n, _IgnoreAllTimeFrameFilters_
, '_FECULVTO'n, _ByMonth_, _ByMonth_, 11, 1, _Full_, {Date}) +
CumulativePeriod(_Sum_, 'Frequency'n, _IgnoreAllTimeFrameFilters_
, '_FECULVTO'n, _ByMonth_, _ByMonth_, 0, 1, _Full_, {Date})

 

cross.png

SAS Innovate 2025: Call for Content

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!

Submit your idea!

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
  • 0 replies
  • 337 views
  • 0 likes
  • 1 in conversation