3 Replies Latest reply: Jul 27, 2017 3:39 AM by Arvind Patil

# YTD calculation for trend line

Hello All,

I need to do a YTD count for a trend line on a combo chart. The count basically should be like a summation of the values populated by the bars and this should be done in a YTD format.

For instance, if June has a count of 1, the line chart should reflect that count and should remain consistent until it finds another count. As you can see, in the month of Jan there is another value of 1 present, so the line chart should add this value to the previous value and show 2 for the month of Jan and continue the same calculation going forward.

As it is a YTD count/accumulation, it should refresh the count at the beginning of every new year, so for instance from Jan 2017, it should start from 0 or whatever the value holds for Jan and then accumulate for the rest of the months.

• ###### Re: YTD calculation for trend line

Hi Joshua,

There is small setting with your expression:

1. First you need to write your expression as YTD:

Sum({<Year= {'\$(=max(year))'}>}Sale)

2. Then check the check box as shown in image attached

• ###### Re: YTD calculation for trend line

But then again, will this help in refreshing the count at the start of a new year ie. Jan 2017 from 0 ?

• ###### Re: YTD calculation for trend line

HI Joshua,

Yes It  will With The help of This Expression:

1. First you need to write your expression as YTD:

Sum({<Year= {'\$(=max(year))'}>}Sale)

Thanks,

Arvind Patil