Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Error in expression

=sum(if(Index(GetFieldSelections(Medication_Tree),Concat('Cost.Sub_Cost_Category1 and  Cost.Sub_Cost_Category2')>0),1,0))

4 Replies
sushil353
Master II
Master II

Hi Hammad,

Could you explain what r u trying to do with the above expression.

HTH

Sushil

SunilChauhan
Champion II
Champion II

try this

sum(if(Index(GetFieldSelections(Medication_Tree),('Cost.Sub_Cost_Category1 & Cost.Sub_Cost_Category2')>0),1,0))

Sunil Chauhan
Not applicable
Author

A bit of context would be good

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

Concat is an aggregation function, not a string concatenation operator. Use & for this. But in your case, if I correctly understand what you are trying to do, I suggest that you use WildMatch:

=sum(if(WildMatch(GetFieldSelections(Medication_Tree), '*Cost.Sub_Cost_Category1*', '*Cost.Sub_Cost_Category2*') > 0), 1, 0)

(count 1 if one or both of the strings are in the selection(s) for Medication_Tree)

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein