Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I am trying to do a nested if. The field I am evaluating can either be a number or text. These are lab results. The text part is when the lab enters a result like - '>15'. If it is this, then I'm trying to put in a "1" into my flag field. The statement is not even recognizing this part of my if statement and I can't figure out why. Here's my statement:
if(num([Event Tag]) > 6, 1,
if(text([Event Tag]) = '>15*', 1, 0)) as INR_Flag6
The first part will evaluate correctly, but the second part won't. Any suggestions will be greatly appreciated! I've tried everything I can think of to get this to work.
Thanks,
nmellick
In the second 'if' statement, use 'like' operator instead of '='. I tried a sample script and it worked for me.
Krishnamoorthy
Hi, I didn't understand what you are trying to accomplish with text([Event Tag]) = '>15*',
maybe you could work with part of the string.
For example,
num( left( [Event Tag],2) )> 15
This gets the two characters on the left, convert it to a number and check if it is higher than 15.
If it not it, please describe your if-condition
Rgds,
Erich
In the second 'if' statement, use 'like' operator instead of '='. I tried a sample script and it worked for me.
Krishnamoorthy
Thanks to both of you for responding! The "Like" word fixed my issue.
nmellick
Hi,
if you are struggling with if-statements (like me ) maybe this can be helpfull:
http://www.qlikblog.at/464/tool-creating-nested-ifstatements/
Regards
Stefan