Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join this live chat April 6, 10AM EST - QlikView to Qlik Sense REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
gorob99
Creator
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
MVP & Luminary
MVP & Luminary

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 II
Specialist II

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 II
Specialist II

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

gorob99
Creator
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 @gorob99 

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
marcus_sommer
MVP & Luminary
MVP & Luminary

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 II
Specialist II

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