Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

mr_novice
Contributor 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
MVP
MVP

Re: if statement with many "greater than" conditions.

May be like:

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

View solution in original post

3 Replies
MVP
MVP

Re: if statement with many "greater than" conditions.

May be like:

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

View solution in original post

Highlighted
mr_novice
Contributor II

Re: if statement with many "greater than" conditions.

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?

MVP
MVP

Re: if statement with many "greater than" conditions.

Yes, you may try like:

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