Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

YTD in Graph

Hello,

My Data is Build with a Account_Id, Year, MonthNbr, MonthValue

Now i would like in a Pivot Table see by Month its YTD (12 month vertical) and beside ther YTD values.

A code Like SUM(IF(??Month??<MonthNbr, MonthValue, 0) should do it, but how can i test the value of the month in the pivotgrid versus the month in the data, as it is based on the same field.

Kind Regards.

6 Replies
amars
Specialist
Specialist

Hi harry,

I am not sure, if I have got it right but instead of using a formula to show it this way , try using full accumulation.

Regards

Amar

Not applicable
Author

If there is more than one year of data available, you will need to have a year field to make sure the YTD data you grab is from the same year, but you can use set analysis to accomplish this:

sum({$<Year = {$(=only(Year))}, MonthNbr = {"<=$(=max(MonthNbr))"}>} MonthValue)

Not applicable
Author

I missed in the title of the topic, my graph is a Pivot Table, and i can't use full Accululation.

@Sue

I've tried this but i'm getting only the month values in the YTD, changing the comparison to just '=' results in the same as '<='

If you want i could post the qv here, but only if yoy have time to watch it. Do'nt want to force in lossing time.

Not applicable
Author

Due to time zones i will still follow this entry from @ home.

But i will already post the qv

You will see that in the sql-query i've also the ytd value as a figure, but its that that i would like to 'disable', in other queries this would be to big to keep it readable.

Not applicable
Author

I may be able to play with this later this evening (USA Mountain time).

Not applicable
Author

Thx, @Home (GMT+1, Belgium Time) Sleep