Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

relational operators in expressions

I was trying to use the <> in an expression as per the Help file

it didn't work but -= did work as not equal

now I want to use greater than - the help file says > , >=, < , <= etc

none of these work - is the help file wrong? it certainly was for the not equal to !!

1 Solution

Accepted Solutions
pover
Luminary Alumni
Luminary Alumni

I assume you're talking about set analysis which has a different syntax than the conditional statement of an if so instead of using sum(if(Year>2000,Amount)) you have to put sum({$<Year={">2000"}>} Amount).

Regards.

View solution in original post

6 Replies
pover
Luminary Alumni
Luminary Alumni

I assume you're talking about set analysis which has a different syntax than the conditional statement of an if so instead of using sum(if(Year>2000,Amount)) you have to put sum({$<Year={">2000"}>} Amount).

Regards.

Not applicable
Author

Thanks for the reply - it works

<PRINCIPAL_ID = {"<>4"}>

but misses some values and doesn't give me the same results as- misses out some data

<PRINCIPAL_ID -= {4}>

do I need the $ sign at the beginning of the set analysis?

pover
Luminary Alumni
Luminary Alumni

<PRINCIPAL_ID = {"<>4"}> is not a valid search as QlikView will interpret the <> as less than and greater than. The result will be all PRINCIPAL_ID's greater than 4. The syntax -= is what you want to use. You can also use <PRINCIPAL_ID = {"=not match(PRINCIPAL_ID,4)"}>

Am I missing some other detail of what you are looking for?

Not applicable
Author

Thanks

The only other question is what would I use if i wanted greater than 2

or if I wanted greater than or equal to 2

pover
Luminary Alumni
Luminary Alumni

If you want PRINCIPAL_ID to be greater than 2 it would be

<PRINCIPAL_ID = {">2"}>

and greater than or equal to 2 would be

<PRINCIPAL_ID = {">=2"}>

Regards.

Not applicable
Author

Thank you very much - it all works fine now

Regards