Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
berryandcherry6
Creator III
Creator III

Getting counts of dynamic values

Hi all,

i am trying to get current_campaign_id by putting  where condition to CurrentCampaignData.and then passing current_campaign_id  to set analysis.

CurrentCampaignData:

Load

batch_meta_data_id,

campaignid as current_campaign_id

Resident CAMPAIGN

WHERE ( current_start_date = Date( weekstart (Num ( today() ) )+1)) and match(batch_meta_data_id ,'23','24');

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


This works fine, but  i want to put this same logic in expression instead of loading in script .How could i do this.?

Please help me in this regard.


Thanks

21 Replies
sunny_talwar

Not sure I understand what you are looking for

berryandcherry6
Creator III
Creator III
Author

Hi Sunny,

According to above solution, for every batch_meta_data_id and current_start_date,i need to create tables like CurrentCampaignData.

I mean for 8 batches i will be needing to create 8 tables in script like CurrentCampaignData to get current_campaign_id according to current_start_date  and batch_meta_data_id.

So is there any other way,where i could acheive this  like  can we use this conditions in setanalysis itself ?to get counts.

Regards

berryandcherry6
Creator III
Creator III
Author

Hi sunny,

Please check i have edited my question, you may ask question if you need clarification.

Thanks,

Supriya

sunny_talwar

May be this:

Count({$<DateType= {'completion'}, final_test_status={'passed'}, batch_meta_data_id = {23, 24}, current_start_date = {"$(=Date(WeekStart(Today()) + 1, 'DateFieldFormatHere))"}>} invitation_id)

Replace DateFieldFormatHere with the date format of current_start_date

berryandcherry6
Creator III
Creator III
Author

Hi sunny,


Count({$<DateType= {'completion'}, final_test_status={'passed'}, batch_meta_data_id = {23, 24}, current_start_date = {"$(=Date(WeekStart(Today()) + 1, 'MM-DD-YYYY'))"}>} invitation_id)



If i do this,it wont filter for particular "current_campaign_id" , here we are not passing current_campaign_id.

The above expression gives same result as ---


Count({$<DateType= {'completion'}, final_test_status={'passed'}, batch_meta_data_id = {23, 24}>} invitation_id)


Thanks

sunny_talwar

How about this:

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

current_campaign_id = p({<batch_meta_data_id = {23, 24}, current_start_date = {"$(=Date(WeekStart(Today()) + 1, 'DateFieldFormatHere))"}>})

>} invitation_id)

berryandcherry6
Creator III
Creator III
Author

Hi,

When i debug below expression used not returning any value

current_campaign_id = p({<batch_meta_data_id = {23, 24}, current_start_date = {"$(=Date(WeekStart(Today()) + 1, 'MM-DD-YYYY'))"}>})

so Whole expression giving same value with this and without this expression. Am i missing anything here.

sunny_talwar

I would expect it to work, not sure what might I be missing.

berryandcherry6
Creator III
Creator III
Author

Hi sunny,

Here i need to get  'current_campaign_id' to get count of invitations.

Please help me on this.

Regards,

Supriya