Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
berkarmagan
Partner - Creator
Partner - Creator

Year to date calculation on pivot table by selected month/s

Hi everyone,

I have a problem about ytd calculation on pivot table. I atteched an example which has the same problem. On the example as you see I ve 2 expression, first one is my formula which is not working properley, second one is basic sum calculation. I need to show ytd calculation by month. I mean if i pick februray on list box, i should see just februray column and it should be january+februray. Wıth my formula, I got true calculation on februrary but january's column also coming with februrary's calculation which shouldn't be come.

On the other hand user can pick more than 1 months,  if march and april picked, pivot table should show these 2 months with ytd by their calculation.

Thanks for now.

10 Replies
oknotsen
Master III
Master III

That looks like something that can be done easier.

How about removing all the IF statements and doing something along the lines of....

SUM({<MonthId = {<=$(=max(MonthId))}>}TOTAL<MonthId, Account>Sales)

May you live in interesting times!