Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am trying to build a simple calculated column as shown below using an If statement with an and operator. How can I rewrite my expression to resolve the "Missing right parenthesis" error
IF(Type='A' and Unit = 'B', 1, 0)
Gotcha - I've never actually used this, didn't even realize it was there! Learn something new every day...
It looks to me like this particular editor doesn't have an 'and' option, which is a tad weird because it's legal Qlik syntax when used in the script editor. Assuming you'd like to remain in Data Manager mode rather than using Script Editor, you could work around it by using a nested if statement - If(Type = 'A', if(Unit = 'B',1,0),0) though I appreciate that is a tad clunky. Perhaps someone else with more knowledge about Data Manager can help you do it more cleanly, though...
Where exactly are you entering this formula? It appears to be correct in Qlik Sense as written (assuming Type and Unit are fields in your app), and the 'and' should be picked up as a keyword and highlighted in blue... but this doesn't look like the standard Qlik Sense formula editor?
Hi, I am entering my formula in the data manager tab. I am new to Qlik -- Do you know if this is not the appropriate place to be adding calculated fields? Oddly, when I reduce my calculated field expression to just an and operator, I get another error: "Unexpected token: and".
Gotcha - I've never actually used this, didn't even realize it was there! Learn something new every day...
It looks to me like this particular editor doesn't have an 'and' option, which is a tad weird because it's legal Qlik syntax when used in the script editor. Assuming you'd like to remain in Data Manager mode rather than using Script Editor, you could work around it by using a nested if statement - If(Type = 'A', if(Unit = 'B',1,0),0) though I appreciate that is a tad clunky. Perhaps someone else with more knowledge about Data Manager can help you do it more cleanly, though...