Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
ShreedeshReddy
Contributor
Contributor

Error: "Missing right parenthesis" when using complex/nested expressions in Data manager

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?

Capture.JPG

 Thank you,

Shreedesh

..

 

 

 

1 Solution

Accepted Solutions
Andrei_Cusnir
Specialist
Specialist

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:

  • For calculated fields, the limitations are found here [1]
  • For expressions, the limitations are found here [2]

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. 
 

---

[1] https://help.qlik.com/en-US/sense/June2020/Subsystems/Hub/Content/Sense_Hub/LoadData/add-calculated-...

[2] https://help.qlik.com/en-US/sense/June2020/Subsystems/Hub/Content/Sense_Hub/Scripting/functions-in-s...

[3] https://community.qlik.com/t5/Knowledge-Base/How-To-Submit-Feature-Requests-For-Qlik-Products/ta-p/1...

Help users find answers! Don't forget to mark a solution that worked for you! 🙂

View solution in original post

1 Reply
Andrei_Cusnir
Specialist
Specialist

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:

  • For calculated fields, the limitations are found here [1]
  • For expressions, the limitations are found here [2]

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. 
 

---

[1] https://help.qlik.com/en-US/sense/June2020/Subsystems/Hub/Content/Sense_Hub/LoadData/add-calculated-...

[2] https://help.qlik.com/en-US/sense/June2020/Subsystems/Hub/Content/Sense_Hub/Scripting/functions-in-s...

[3] https://community.qlik.com/t5/Knowledge-Base/How-To-Submit-Feature-Requests-For-Qlik-Products/ta-p/1...

Help users find answers! Don't forget to mark a solution that worked for you! 🙂