Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
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