BookmarkSubscribeRSS Feed
AlexWangVA
Calcite | Level 5

Hello everyone,

I am working with SAS Visual Analytics and trying to create a bar chart that displays cumulative totals across multiple date hierarchies (e.g., Year and Month). I have successfully implemented a basic cumulative total using the CumulativePeriod function for a single year, following the approach suggested in a recent community thread (using CumulativePeriod(_Sum_, Value, IgnoreAllTimeFrameFilters, 'Year'n, Inferred, ByYear, 0, 1, Full)).

However, my requirement extends beyond a single date hierarchy. Specifically, I need the cumulative total to reset at the beginning of each year while still displaying data for multiple years side by side in the same bar chart. When I add multiple years to the category role, the cumulative calculation does not behave as expected — it either accumulates across all years without resetting, or returns missing values due to date reference conflicts.

My questions are:

  1. How can I configure the CumulativePeriod calculation to properly reset at each year boundary when multiple years are displayed in a bar chart?
  2. Is there a recommended approach for handling mixed date hierarchies (e.g., Year as a group-by and Month as the category) in cumulative calculations?
  3. Are there any known limitations or workarounds when using Period to Date calculations across multiple date hierarchies in SAS VA?

I am using SAS Viya 4 with the latest version of Visual Analytics. Any guidance or examples would be greatly appreciated.

Thank you!

1 REPLY 1
sbxkoenk
SAS Super FREQ

on using the CumulativePeriod operator ...

 

See
VA Report Example: Ways to use the Cumulative Period operator
by TeriPatsilaras on 23-SEP-2020

https://communities.sas.com/t5/SAS-Communities-Library/VA-Report-Example-Ways-to-use-the-Cumulative-...

 

The above SAS Communities Library - article also discusses a cumulative sum of monthly expenses with a reset for each year.

 

BR, Koen

Catch up on SAS Innovate 2026

Dive into keynotes, announcements and breakthroughs on demand.

Explore 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
  • 1 reply
  • 290 views
  • 0 likes
  • 2 in conversation