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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Architect
Partner - Creator
Partner - Creator

Set expression

Can anyone please explain the meaning of this condition?

[Base Year] = max({1} [Base Year])

If I select 2021 as Base Year, what will be the output?

@marcus_sommer 

Labels (1)
2 Solutions

Accepted Solutions
marcus_sommer

Like mentioned the {1} ignored any selections within the expression of max({1} [Base Year]). Just put it within a text-box to see if it changed by any selections. If your overall expression which contained this as an expression-part did change it means that the other parts are further directly associated to selections.

- Marcus

View solution in original post

jwjackso
Specialist III
Specialist III

In the first image, "=[Base Year]=Max({1}[Base Year])" is returning a boolean (True (-1) or False(0)).  In the filter pane, 2018 is selected.  "Max([Base Year]) is returning the maximum of the years available, 2018.  "Max({1}[Base Year]) looks at all the years and returns 2021.

set1.PNG

In the second image, 2020 is selected in the filter pane.  "Max([Base Year]) is returning the maximum of the years available, 2020.  "Max({1}[Base Year]) looks at all the years and returns 2021.

set2.PNG

View solution in original post

5 Replies
jwjackso
Specialist III
Specialist III

The {1} ignores filters and represents the complete data set.  No matter which year you select, you should get the maximum year.

Architect
Partner - Creator
Partner - Creator
Author

HI @jwjackso 

Thanks for the explanation.

Though I am looking for something more detailed.

like

[Base Year] = max({1} [Base Year])

if we select 2018,2019,2020 and 2021 one after another will the condition be satisfied every time?

I can see with the change of the [Base Year] selection the output value is changing too.

 

MayilVahanan

Hi @Architect 

Max({1}BaseYear) gives always the maximum Year. For ex: In your case, its 2021.

If you create the text box, and use this [Base Year] = max({1} [Base Year]) expression.

Output will be -1 when you select 2021, else it will give zero at all the remaining case. 

Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
marcus_sommer

Like mentioned the {1} ignored any selections within the expression of max({1} [Base Year]). Just put it within a text-box to see if it changed by any selections. If your overall expression which contained this as an expression-part did change it means that the other parts are further directly associated to selections.

- Marcus

jwjackso
Specialist III
Specialist III

In the first image, "=[Base Year]=Max({1}[Base Year])" is returning a boolean (True (-1) or False(0)).  In the filter pane, 2018 is selected.  "Max([Base Year]) is returning the maximum of the years available, 2018.  "Max({1}[Base Year]) looks at all the years and returns 2021.

set1.PNG

In the second image, 2020 is selected in the filter pane.  "Max([Base Year]) is returning the maximum of the years available, 2020.  "Max({1}[Base Year]) looks at all the years and returns 2021.

set2.PNG