Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Talend Cloud AWS EU Scheduled Outage: Starting Tues 26 May 21:00 CEST with expected completion Wed 27 May 01:00 CEST
cancel
Showing results for 
Search instead for 
Did you mean: 
ioannagr
Creator III
Creator III

Problem with dual if operators

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

Labels (2)
12 Replies
agigliotti

let's try replacing double quote " with single quote '.

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it
ioannagr
Creator III
Creator III
Author

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?

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Replace the double quotes with single quotes. Then the syntax of the expression will be correct. Works for me anyway.

 

 


talk is cheap, supply exceeds demand
agigliotti

where are you using that expression?

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it
ioannagr
Creator III
Creator III
Author

In the data manager.

ioannagr
Creator III
Creator III
Author

Using "calculated field" option.

ioannagr
Creator III
Creator III
Author

Hello Gysbert.

 

This is what I'm getting even if I replace with single quotes. 

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

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.


talk is cheap, supply exceeds demand
ioannagr
Creator III
Creator III
Author

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