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

nested IF based on variable outputs

Hi

Im trying to get the max number of days based on criteria set by a user selected data using variables and input boxes, I have already got an individual straight table that will give the max days based on one criteria, but now need based on many

example of my code to do this is:

=if(months=POI and project=DRTYPE and [country]=LOC, max(compdays))  - Just returns NULL though expression says OK

So in this scenario, user selects number of months required, then the project type and then the location, based on this the result should be the maximum days

Only way I can get max days correctly is a straight tables with those fields, and then a separate statistic box, which is OK, but I have another text box that computes the max days by a cost, so this way the user would have to manually key the max days to get cost, which is then subject to input error

Using Qlikview

Thanks

Kev

1 Solution

Accepted Solutions
vinieme12
Champion III
Champion III

try

=     Max( if(months=POI and project=DRTYPE and [country]=LOC, compdays ) )


also what is the definition of these variables? are they defined with a preceding equal sign?

also try $ expansion so the variables evaluate

Max( if(months=$(POI) and project=DRTYPE and [country]=LOC, compdays ) )



Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

1 Reply
vinieme12
Champion III
Champion III

try

=     Max( if(months=POI and project=DRTYPE and [country]=LOC, compdays ) )


also what is the definition of these variables? are they defined with a preceding equal sign?

also try $ expansion so the variables evaluate

Max( if(months=$(POI) and project=DRTYPE and [country]=LOC, compdays ) )



Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.