Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
tomgurgeracy
Contributor
Contributor

Set Analysis with a Variable In linest_m Function

Hello Everyone,

I Would Love your Assistance In The Following Matter:

I Want To Create A Linest_m Measure To see How Much Leads (Outsource_Lead_ID) I Get Per Day Per Campaign (DateKey, Campaign).

The Matter is that I Want To Do it Just For The Last Ten Days Of The Campaign.

Now, I Have A Variable Named 'TenDaysBeforeEndCampaign' That Calculates The Date That Was Ten Days Before The Ending Date Of The Campaign.

This is my Expression, But It Does Not Work. Please Ignore the irrelevant conditions in the set analysis:

linest_m(total <DateKey,Campaign> aggr(if(Count({<DateKey >= {"<$(TenDaysBeforeEndCampaign)"},Flag_Is_Same_Lead = {0}, Flag_Answered_Calls ={1}>} Outsource_Lead_ID),Count({<DateKey >= {"<$(TenDaysBeforeEndCampaign)"},Flag_Is_Same_Lead = {0}, Flag_Answered_Calls ={1}>} Outsource_Lead_ID)),DateKey, Campaign),DateKey)

Please let me know what is wrong with this Expression.

Many Thanks,

Tom.

2 Replies
tomgurgeracy
Contributor
Contributor
Author

I Also Tried Like This But It Does not Seem To Work:

linest_m(total <DateKey,Campaign> aggr(if(Count({<DateKey = {'>=$([TenDaysBeforeEndCampaign])'},Flag_Is_Same_Lead = {0}, Flag_Answered_Calls ={1}>} Outsource_Lead_ID),Count({<DateKey = {'>=$([TenDaysBeforeEndCampaign])'},Flag_Is_Same_Lead = {0}, Flag_Answered_Calls ={1}>} Outsource_Lead_ID)),DateKey, Campaign),DateKey)

 

The Result I Get Is The Same As If I Didn't Have This Condition:

DateKey = {'>=$([TenDaysBeforeEndCampaign])'}

 

tomgurgeracy
Contributor
Contributor
Author

Anybody?