Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Everyone,
When I'm trying to add a calculated field using Nested If with AND operator, it's showing an error: missing right parenthesis
Can you please send the right expression?
Thank you,
Shreedesh
..
Hello,
I understand that you are using this expression in Data manager and thus you are getting the error "Missing right parenthesis".
There was an internal investigation conducted by the RnD team where they have confirmed that Data manager doesn't support complex/nested expressions. The limitations are mentioned below:
Additionally the RnD team has stated that at top of each of those pages (above) states where these rules apply. You can use expressions for charts and load scrips, and for calculated fields appears to be primarily editing an already loaded data table. So best to apply nested style expressions in your load script, and then you would not have to make calculated fields.
The only solution for this use case scenario, as mentioned also by the RnD team, is to use Data load editor script like this:
Table2:
Load
if((Enrolled>=1) and (Trained>=1) and (Assessed>=1) and (Certified>=1) and (Passed>=1), 'Enrolled',
if((Enrolled>1) and (Trained>1) and (Assessed>1) and (Certified>1) and (Passed>1), 'Trained',
if((Enrolled>1) and (Trained>1) and (Assessed>1) and (Certified>1) and (Passed>1) , 'Assessed',
if((Enrolled>1) and (Trained>1) and (Assessed>1) and (Certified>1) and (Passed>1) , 'Certified',
if((Enrolled>1) and (Trained>1) and (Assessed>1) and (Certified>1) and (Passed>1) , 'Passed'))))) as Data
[...]
NOTE: I have used the same ">" operator in all the nested expressions for testing purposes, since I needed only to test the logical operator AND.
You can also notice that in Data manager the "AND" appears in BLACK color, which means that at this expression editor it is not recognized as reserved keyword, while in Data load editor it is marked with BLUE color, which means that it is recognized.
You can create an feature request [3] if you like to have Data manager include the AND logical operator as well.
I hope that this information was helpful. In case I have misunderstood the use case scenario, please elaborate in details by providing additional information. However, if it has helped you resolve the issue, please mark it as accepted solution to give further visibility to other community members.
---
Hello,
I understand that you are using this expression in Data manager and thus you are getting the error "Missing right parenthesis".
There was an internal investigation conducted by the RnD team where they have confirmed that Data manager doesn't support complex/nested expressions. The limitations are mentioned below:
Additionally the RnD team has stated that at top of each of those pages (above) states where these rules apply. You can use expressions for charts and load scrips, and for calculated fields appears to be primarily editing an already loaded data table. So best to apply nested style expressions in your load script, and then you would not have to make calculated fields.
The only solution for this use case scenario, as mentioned also by the RnD team, is to use Data load editor script like this:
Table2:
Load
if((Enrolled>=1) and (Trained>=1) and (Assessed>=1) and (Certified>=1) and (Passed>=1), 'Enrolled',
if((Enrolled>1) and (Trained>1) and (Assessed>1) and (Certified>1) and (Passed>1), 'Trained',
if((Enrolled>1) and (Trained>1) and (Assessed>1) and (Certified>1) and (Passed>1) , 'Assessed',
if((Enrolled>1) and (Trained>1) and (Assessed>1) and (Certified>1) and (Passed>1) , 'Certified',
if((Enrolled>1) and (Trained>1) and (Assessed>1) and (Certified>1) and (Passed>1) , 'Passed'))))) as Data
[...]
NOTE: I have used the same ">" operator in all the nested expressions for testing purposes, since I needed only to test the logical operator AND.
You can also notice that in Data manager the "AND" appears in BLACK color, which means that at this expression editor it is not recognized as reserved keyword, while in Data load editor it is marked with BLUE color, which means that it is recognized.
You can create an feature request [3] if you like to have Data manager include the AND logical operator as well.
I hope that this information was helpful. In case I have misunderstood the use case scenario, please elaborate in details by providing additional information. However, if it has helped you resolve the issue, please mark it as accepted solution to give further visibility to other community members.
---