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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Fred12
Contributor III
Contributor III

Error in set modifier ad hoc element list : ',' or ')' expected

Hello, I try to do a sum with set analysis and variables.

 

Here my code : 

Sum({$<PERIODE={$(test1)}>}[VM])

+

Sum({$<PERIODE={$(test2)}>}[VM])

 

In test1, I have : 

=SubField(GetFieldSelections(PERIODE), ',' ,1)

 

in test2, I have :

=SubField(GetFieldSelections(PERIODE), ',' ,2)

 

If I do only  Sum({$<PERIODE={$(test1)}>}[VM])    then it works,  but if I add second sum, it put me error.

 

How can I solve it please.

 

Thanks in advance

Labels (3)
2 Replies
NadiaB
Support
Support

@Fred12 

If the calculation works with the fist variable, probably the evaluation of the second one is returning something that is causing the problem, there is something that =SubField(GetFieldSelections(PERIODE), ',' ,2) is returning that is not working fine, if you using this in a text table, instead of using =SubField(GetFieldSelections(PERIODE), ',' ,2) as part of a calculation, just create another measure with that calculation (=SubField(GetFieldSelections(PERIODE), ',' ,2)) so you can see what is being returned and identify what is braking the calculation. 

Hope it helps. 

Don't forget to mark as "Solution Accepted" the comment that resolves the question/issue. #ngm
vinieme12
Champion III
Champion III

enclose in single quotes, also you must ensure there are always at least 2 selected values in PERIODE field

 

Sum({$<PERIODE={'$(=test1)'}>}[VM])

+

Sum({$<PERIODE={'$(=test2)'}>}[VM])

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.