Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

berryandcherry6
Contributor 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

Tags (1)
1 Solution

Accepted Solutions

Re: dynamic values in set expression not working

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
4 Replies

Re: dynamic values in set expression not working

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
MVP
MVP

Re: dynamic values in set expression not working

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
Contributor II

Re: dynamic values in set expression not working

Hi gwassenaar ,

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

Regards,

Supriya R

berryandcherry6
Contributor II

Re: dynamic values in set expression not working

Hi swuehl ,

Thanks for your explaination , it was clear and understandable.

Regards,

Supriya

Community Browser