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: 
tim_m
Partner - Contributor III
Partner - Contributor III

Accumulation Year-over-Year e.g. YTD

Hi Qlikers,

I accumulate my sales with this formula:

rangesum( above( sum([Expression1]),0,rowno()))

But I need to implement a second measure to get a second stream in my visualization that displays the Year-over-Year e.g. YTD Figures from the last year e.g. the last month.

I have problems to define this second measure: I am aware that I need to implement something like this (I read it in the community):

=Sum({$<Date = {'>$(=Max((YearStart(Date)))) <=$(=Max(Today()))'}>} sales)

But at which point in my second measure do I have to insert this? That means additionally, that I have to complete my first measure ((This ist my first measure: rangesum( above( sum([Expression1]),0,rowno())))) with an additional information about the actual year.

Furthermore when I want to calculate the previous month, except the issue accululation, I get wrong figures: Here my expression:

Sum({$<Year={"2017"}>}Sales)

Sum({$<Year={"2016"}>}Sales)

Both shows the same chart in my dashboard, although the data in 2016 is different to the data in 2017, I am helpless.

Can you help me to put together my first measure with the information about the actual YTD-Information and the second to display the sales from the last period e.g. last year or last month and explain me, why I get the same chart in my 2017 and 2016 expression?

ManyThanks,

Regards, Tim

3 Replies
jolivares
Specialist
Specialist

Try to post some data and the output expected ...

sunny_talwar

Tim - are you able to share some sample data and explain what you are looking to get from it?

tim_m
Partner - Contributor III
Partner - Contributor III
Author

‌Thanks for your post. What kind of sample Data do you mean? In my facts table I have tables like to show months and year. I need help in set analysis to insert a formula like the first one but with additional context that figures the previous year. I am a novice in qlik