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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Passing dynamic values to set analysis

Hi all,

I have table where campaign_id is a field which has many values, each week campaigns are created on client and batch specific.

For ex: batch_id = 1 has 4 campaigns and batch_id = 2 has 3 campaigns every week.

I need sum of user completed on batch specific. for ex:

Sum({$<batch_id = {'1'}, campaign_id = {"Need to pass dynamic values to here depending on week"}>}user_completed)

If i want current week campaigns i need to pass the current week campaigns, If last week i need to pass last week campaigns.

campaign_start_date    batch_id      campaign_id

     05-17-2016                 1                  400

    05-17-2016                 1                  401

    05-17-2016                 1                  402

    05-17-2016                 1                  403

Now i need to include these 4 campaign_id's to above set analysis how can i achieve this.

Regards,

Pramod

Message was edited by: Kumar Pramod

17 Replies
Not applicable
Author

no problem if i hardcode the batchId but i need dynamic campaign_id on the basis of that batch_id

Kushal_Chawda

then try this

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

campaign_id = {"$(=concat( distinct {<batch_id={'1'}>} chr(39) & campaign_id  & chr(39) ,','))"}>} invitation_id)

Not applicable
Author

Your current expression returning zero

you have left one more constraints that start_date of campaign_id should be checked, that should be 17-05-2016 for this week and next week it should be change to 24-05-2016

Kushal_Chawda

This Date is also hardcoded or it is Weekstart Date?

Not applicable
Author

Weekstart Date

Kushal_Chawda

then try this

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

campaign_id = {"$(=concat( distinct {<batch_id={'1'},campaign_start_date={"$(=Date(Weekstart(today()),'DD/MM/YYYY'))"}>} chr(39) & campaign_id  &chr(39) ,','))"}>} invitation_id)

Note: Change your Date format accordingly and should match with campaign_start_date date format

Not applicable
Author

Sorry it's not working,

$(=chr(39) & Concat(Distinct {<batch_meta_data_id={'23','24'}>} campaign_id, ',') & chr(39))  If i use this expression text image it's printing all the campaign id's

if i add below expresion it's not printing anything

campaign_start_date={"$(=Date(Weekstart(today()),'DD-MM-YYYY'))"}


If i add the same thing to complete expression it is printing zero

Not applicable
Author

Hi Sunny please help on this,

reddys310

stalwar1

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

campaign_id = {

$(=chr(39) & Concat(Distinct {<batch_meta_data_id={'23','24'},

current_start_date=(=Date(Weekstart(today())+1))>} campaign_id, ',') & chr(39))

}>} invitation_id)

If i hardcode campaign_id like below it's working but not for dynamic values how can i fix this.

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

campaign_id = {351,352}>} invitation_id)

Even this is printing the value in image and text object

$(=chr(39) & Concat(Distinct {<batch_meta_data_id={'23','24'},current_start_date=(=Date(Weekstart(today())+1))>} campaign_id, ',') & chr(39))