Qlik Community

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
IMPORTANT security patches for GeoAnalytics Server available to download: READ DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
Michael_Hart
Contributor II
Contributor II

Setting the max date with filter

Hi all,

I currently have [Spend] data that I'm wanting to present in a simple table: 

Vendor Selected Year Spend - 2020 Previous Year Spend - 2019
A 1000 1250
B 400 500
C 800 300

 

How can I create a filter pane that when a user selects 2020 for example all the [Spend] data from 2019 is still available so I can display the previous years result with set analysis.

Much appreciated,

Michael

1 Solution

Accepted Solutions
Lisa_P
Employee
Employee

Dimension: Vendor

Measure 1: Sum({$<Year={$(=Max(Year))}>}Spend)

Measure 2: Sum({$<Year={$(=Max(Year)-1)}>}Spend)

View solution in original post

3 Replies
Lisa_P
Employee
Employee

Dimension: Vendor

Measure 1: Sum({$<Year={$(=Max(Year))}>}Spend)

Measure 2: Sum({$<Year={$(=Max(Year)-1)}>}Spend)

Michael_Hart
Contributor II
Contributor II
Author

Thank you Lisa!

If you have a moment could you explain how the selection works?

Thank you again 🙂

Lisa_P
Employee
Employee

The expressions Max(Year) and Max(Year)-1 are based on the years available/selected, so will dynamically change based on selections. When you want to evaluate the contents of an expression in set analysis you need to put it in a $( ) - Dollar sign expansion.