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: 
mr_novice
Creator II
Creator II

if statement with many "greater than" conditions.

Hello all!

I have an if statement that works fine:

IF(

     C0>C1

AND C0>C2

AND C0>C3

AND C0>C4

......

AND C0>C10

,1,0)

Do you have any suggestions of how to write this in a shorter way?

Cant do a rangemax(C0,.....,C10)=C0 because sometimes C0=C1 (or other) and the condition is not correct.

Any suggestions?

Br

Cris

1 Solution

Accepted Solutions
tresesco
MVP
MVP

May be like:

If( C0>RangeMax(C1,C2,...C10), 1,0)

View solution in original post

3 Replies
tresesco
MVP
MVP

May be like:

If( C0>RangeMax(C1,C2,...C10), 1,0)

mr_novice
Creator II
Creator II
Author

This works! I didn't think of this. Haha.

But. My condition with C0>C1.... will also give me a 0 when one of the values is null(). Is there a way of taking care of null values?

tresesco
MVP
MVP

Yes, you may try like:

If( C0>RangeMax(C1,C2,...C10) OR IsNull(C1+C2+...C10), 1,0)