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

if(greater=1,>,<) syntax

In the expression or script, I want to add logic,  volumn ("greater" or "less" depends on the vSet boolean value) than 10.

if(volumn"????"10, dosth, dosthelse)

My question is how to write the "????" part.

It should be something like.  if(greater=1,>,<).

I have tried:

if(volumn&if(greater=1,'>','<')&10, dosth, dosthelse), but it is not working.

6 Replies
rustyfishbones
Master II
Master II

Can you share the App?

juleshartley
Specialist
Specialist

I would use variables:

Set

vGreater= if(volumn>10,dothis, elsethis)

and

vLess=if(volumn<10,dothis,elsethis)

Then use an expression like:

if('$(vSet)' ='>', '$(vGreater)','$(vLess)')

You could use less variables etc. but this keeps it clear...


swuehl
MVP
MVP

Try maybe

=if(volumn $(=if(greater=1,'>','<')) 10, dosth, dosthelse)

PrashantSangle

Hi,

You can set your symbol in variable.

and then use that variable in your logic..

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Not applicable
Author

try something like this in the expression:

=if($(vSet) =1, if(volumn > 10, dosth), dosthelse)

Not applicable
Author

Thanks, this is working.