Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Highlighted
tomgurgeracy
New 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
New Contributor

Re: Set Analysis with a Variable In linest_m Function

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

Re: Set Analysis with a Variable In linest_m Function

Anybody?