BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
klroesner
Quartz | Level 8

Hi,

we want to display the cumulative totals for the years 2022 and 2023 in a line chart. Unfortunately, this does not work

 

klroesner_0-1770905046444.png

 

 

Max view of the diagram:

 

klroesner_1-1770905046448.png

 

 

Cumlative Totals definition (value_agg):

klroesner_2-1770905046448.png

 

. Only when a filter is applied to the year 2022 are the correct values displayed.

 

klroesner_3-1770905046451.png

 

 

Can everyone give us a hint as to what we are doing wrong?

 

Best Regards

Klaus

1 ACCEPTED SOLUTION

Accepted Solutions
TSBruce
SAS Employee

I think you may need to use a Period to Date calculation using the full data (not using the default ToToday)  instead of a Cumulative Total.  Here is my expression:

 
CumulativePeriod(_Sum_, Value, IgnoreAllTimeFrameFilters, 'Year'n, Inferred, ByYear, 0, 1, Full)

 

And here is my results in a line chart:

 

Cumulative.png

 

Please let me know if this gets you what you need.

View solution in original post

4 REPLIES 4
TSBruce
SAS Employee

I think you may need to use a Period to Date calculation using the full data (not using the default ToToday)  instead of a Cumulative Total.  Here is my expression:

 
CumulativePeriod(_Sum_, Value, IgnoreAllTimeFrameFilters, 'Year'n, Inferred, ByYear, 0, 1, Full)

 

And here is my results in a line chart:

 

Cumulative.png

 

Please let me know if this gets you what you need.

klroesner
Quartz | Level 8

Hi TSBruce, That looks wonderful! 😍  But I can't quite reproduce it yet. 

 

I created the CAS Table as follows:

 

data public.test_agg1 (promote=yes);
	set cpm0978.test_agg;
	attrib dyear length=8 format=year.;
	attrib dmonth length=8 format=month.;
	dyear=mdy(month, 1, year);
	dmonth=mdy(month, 1, year);
run;

klroesner_0-1770934975670.png

Unfortunately, the YTD metric only generates missing values and get a error message:

 

klroesner_1-1770935072663.png

Error message: "A mix of date references has resulted in missing values being returned for a period calculation. Consider creating the date references by duplicating the data element and then adjusting the properties of the duplicated data element. For example, you can change the format."

 

Definition: CumulativePeriod(_Sum_, 'value'n, _IgnoreAllTimeFrameFilters_, 'dyear'n, _Inferred_, _ByYear_, 0, 1, _Full_, {Date})

 

Can you give me a hint as to what I'm doing wrong?

 

I'm looking forward to your reply.

 

Klaus

klroesner
Quartz | Level 8

Hello Bruce! A colleague advised me to duplicate the month column and use the Year. format. And what can I say? It works! Bruce, you made our day! 

 

And it beautifully demonstrates the power of SAS VA! 🙂

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
  • 4 replies
  • 495 views
  • 1 like
  • 2 in conversation