Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
berryandcherry6
Creator II
Creator II

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

This is a pure guess, but does this make any difference?

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

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

>} invitation_id)

CELAMBARASAN
Partner - Champion
Partner - Champion

Please check the below expression, which will work for you I guess


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

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

>} invitation_id)

berryandcherry6
Creator II
Creator II
Author

Hi,

i am getting -2028 for  $(=Date(WeekStart(Today()) + 1, 'MM-DD-YYYY'))

and comparing this with current_start_date = date(floor(start_date),'MM-DD-YYYY') as current_start_date,


May be this is effecting?


am i right in putting DateFieldFormatHere in expression?



sunny_talwar

Check this in text box object:

=Date(WeekStart(Today()) + 1, 'MM-DD-YYYY')


Without dollar sign expansion

berryandcherry6
Creator II
Creator II
Author

Hi,

Its giving same count with or without using current_start_date = {"$(=Date(WeekStart(Today()) + 1, 'MM-DD-YYYY'))"}

So could you explain me how get or check whether i am passing campaign_id for expression.

I tried putting below expression to textbox it displays nothing.

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


Thanks


CELAMBARASAN
Partner - Champion
Partner - Champion

Create a Straight table

Dimension - Campaign_id

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

And check whether you get the desired Campaign_IDs

berryandcherry6
Creator II
Creator II
Author

hi,

yes i am getting 05-17-2016 (i.e in MM-DD-YYYY format ),

how could i know in my expression whether  current_campaign_id  is getting passed or not.

Thanks

sunny_talwar

To check that, you can try this:

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

>} current_campaign_id, ', ')

This will give you a comman separated list of all current_campaign_ids that are getting included via the p() function

berryandcherry6
Creator II
Creator II
Author

Hi,

No, it is not displaying anything in text box.

berryandcherry6
Creator II
Creator II
Author

Hi,

I am getting  same values both in Dimension and expression.Both are equal in lenght and values.

But it is filtering for batch id's 23 and 24.

I think its not filtering for current_start_date as it showing all values.

Thanks