Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
berryandcherry6
Creator II
Creator II

dynamic values in set expression not working

Hi all,

I am using set analysis to evaluate some condition. I am not able to get any count after adding campaign_id = {$(=chr(39) & Concat(Distinct current_campaign_id, ',') & chr(39))} , i am getting zero.

But if i had it in textbox i get values.

expression :

$(=chr(39) & Concat(Distinct current_campaign_id, ',') & chr(39))

values i get: 350,351

so now i am passing this values to set analysis by using this ,to compare 350,351 values present in campaign_id and evaluate condition,but it giving me zero.

count({$<DateType= {'completion'},final_test_status={'passed'},

campaign_id = {$(=chr(39) & Concat(Distinct current_campaign_id, ',') & chr(39))}>} invitation_id)

Please help me on this

Regards

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Check that this returns a result:

count({$<DateType= {'completion'},final_test_status={'passed'},

campaign_id = {'350,351'}>} invitation_id)

What you probably want is {350,351} instead of {'350,351'}. In that case you can use $(=Concat(Distinct current_campaign_id, ',') )

Or a bit simpler:

count({$<DateType= {'completion'},final_test_status={'passed'},campaign_id = P(current_campaign_id)>} invitation_id)


talk is cheap, supply exceeds demand

View solution in original post

4 Replies
Gysbert_Wassenaar

Check that this returns a result:

count({$<DateType= {'completion'},final_test_status={'passed'},

campaign_id = {'350,351'}>} invitation_id)

What you probably want is {350,351} instead of {'350,351'}. In that case you can use $(=Concat(Distinct current_campaign_id, ',') )

Or a bit simpler:

count({$<DateType= {'completion'},final_test_status={'passed'},campaign_id = P(current_campaign_id)>} invitation_id)


talk is cheap, supply exceeds demand
swuehl
MVP
MVP

Note that

$(=chr(39) & Concat(Distinct current_campaign_id, ',') & chr(39))


will return (with your two sample values):


'350,351'


while you need to create either


'350','351'


or


350,351


Hence:


$(=chr(39) & Concat(Distinct current_campaign_id, chr(39)& ',' &chr(39) ) & chr(39))


or


$(=Concat(Distinct current_campaign_id, ',' ) & chr(39))


Looking at your code, this might also work


count({$<DateType= {'completion'},final_test_status={'passed'},

campaign_id = p(current_campaign_id) >} invitation_id)

berryandcherry6
Creator II
Creator II
Author

Hi gwassenaar ,

Thanks it worked. And debug answer provided it was helpful to understand.

Regards,

Supriya R

berryandcherry6
Creator II
Creator II
Author

Hi swuehl ,

Thanks for your explaination , it was clear and understandable.

Regards,

Supriya