Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone.
I seem to be facing an issue regarding "dual if" expression. So I have two variables, systolicpressure and diastolicpressure and I want to combine them in order to create categories for bloodpressure.
What I type is :
If(systolicpressure<=120 and diastolicpressure<=80,"normal",
If((systolicpressure>120 and systolicpressure<=129) and (diastolicpressure<=80),"elevated",
If((systolicpressure>=130 and systolicpressure<=139) or (diastolicpressure>80 and diastolicpressure<=89),"high blood pressure- hypertension stage 1",
If((systolicpressure>=140 and systolicpressure<180) or (diastolicpressure>=90 and diastolicpressure<120),"high blood pressure- hypertension stage 2",
If(systolicpressure>=180 and diastolicpressure>=120,"hypertensive crisis",
If(systolicpressure>=180 or diastolicpressure>=120,"hypertensive crisis", "null"))))))
I get the message: "missing right parenthesis" but this is not the case I believe; I tried a shorter version of this expression and it worked perfectly, but when the operator comes in I get error messages.
What am I doing wrong? Any help is appreciated.
Thank you,
Ioanna
let's try replacing double quote " with single quote '.
Hi and thank you for your reply.
Nope, problem still there.
Getting "missing right parenthesis".
Could it be something about the version I'm using?
Replace the double quotes with single quotes. Then the syntax of the expression will be correct. Works for me anyway.
where are you using that expression?
In the data manager.
Using "calculated field" option.
Hello Gysbert.
This is what I'm getting even if I replace with single quotes.
Data manager can't handle multiple conditions in an if statement. Bummer.
You can try nesting if's even further. Or just use the Data load editor instead.
How are nested if's different to this expression I wrote? Maybe it's details I don't grasp at first glance. Seem pretty similar to me, if not the same.
Thank you for responding.
Ioanna