Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

comparison operator in if statement

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.

1 Solution

Accepted Solutions
cgdonders
Partner - Creator
Partner - Creator

Like this:

If (vSet = 0, if (volumn <10, dosth, dosthelse), if (vSet =1, if (volumn> 10, dosth, dosthelse))

View solution in original post

6 Replies
jvitantonio
Luminary Alumni
Luminary Alumni

Hi, not sure what you ar trying to achieve, but you can use if like this:

If(Volume > 1 OR Volume < -1, Expression, ElseExpression)

If(Volume >1 AND Volume <10, Expression, ElseExpression)

If(Volume = 1, Expression, ElseExpression).

I Hope this helps.

JV

whiteline
Master II
Master II

Hi.

LET vSet = '>';

if(volumn$(vSet)10, dosth, dosthelse)

cgdonders
Partner - Creator
Partner - Creator

Like this:

If (vSet = 0, if (volumn <10, dosth, dosthelse), if (vSet =1, if (volumn> 10, dosth, dosthelse))

Not applicable
Author

This is the logic I want, but would be much better if I can change comparison operator within a if statement.

I got the correct answer.

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

Not applicable
Author

This syntax does not work.

cgdonders
Partner - Creator
Partner - Creator

then the answer of whiteline must do the trick, I think.

In my reply I forgot a ')'. it must be like:

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