Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
datagrrl
Creator III
Creator III

YTD YOY Question

I found this article, which was helpful, but not exactly what I need to do.

Set Analysis - YTD Compared with Previous Years (Same Parameter)

I need to find which month is the most recent month we have data for and compare it to the same cumulative total for the year at this time last year.

I am attaching an app I mocked up that should simulate the problem.

The example above would work well if I was updating daily, but the grain of the data is at a month level, and may be delayed a few days, so in early June I might be up to either April or May.

This works well if I had data for the entire year.

Sum({$<Year={$(=Year(Today())-1)},Type={'Sales'}>}Value)-Sum({$<Year={$(=Year(Today()))},Type={'Sales'}>}Value)

Any assistance is appreciated.

1 Solution

Accepted Solutions
boorgura
Specialist
Specialist

Please use this expression instead:

='YTD YOY Sales: ' & num(Sum({$<Year={$(=Year(Today())-1)},Type={'Sales'}, Month = {"<=$(=Max({$<Type={'Sales'},Year={$(=Year(Today()))}>}Month))"}>}Value)-Sum({$<Year={$(=Year(Today()))},Type={'Sales'}>}Value))

View solution in original post

2 Replies
boorgura
Specialist
Specialist

Please use this expression instead:

='YTD YOY Sales: ' & num(Sum({$<Year={$(=Year(Today())-1)},Type={'Sales'}, Month = {"<=$(=Max({$<Type={'Sales'},Year={$(=Year(Today()))}>}Month))"}>}Value)-Sum({$<Year={$(=Year(Today()))},Type={'Sales'}>}Value))

datagrrl
Creator III
Creator III
Author

Thanks...I feel like I was getting close, but that last step was just not working out for me. I also realize I had the original calculation backwards.