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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
ali_hijazi
Partner - Master II
Partner - Master II

how to write this in set analysis

Hello

I want to get the maximum phase number that is common in the current selection set of data and the set of data where season = last year's season

Ok

the user selects current season say it is 122 then last year's season is 112

max(PhaseNo) gives 1

max({<Season={$(vLastYearSeason)}>} PhaseNo) gives 5

knowing that $(vLastYearSeason) is 112

and if I put PhaseNo is a list box then when season is 122 then I have only Phase 1 in white

whereas when season is 112 i have phase 1 to phase 5 in white

Please advise

I can walk on water when it freezes
1 Solution

Accepted Solutions
ali_hijazi
Partner - Master II
Partner - Master II
Author

I solved it this way

I created a variable with the following definition

=max(PhaseNo)

and let's say I gave it a name newVariable...

then I modified the expression as follows:

max({<Season={$(vLastYearSeason)}> * $} if(PhaseNo<=$(newVariable),PhaseNo))

I can walk on water when it freezes

View solution in original post

2 Replies
sujeetsingh
Master III
Master III

use set modifier $1 for previous selection.

ali_hijazi
Partner - Master II
Partner - Master II
Author

I solved it this way

I created a variable with the following definition

=max(PhaseNo)

and let's say I gave it a name newVariable...

then I modified the expression as follows:

max({<Season={$(vLastYearSeason)}> * $} if(PhaseNo<=$(newVariable),PhaseNo))

I can walk on water when it freezes