Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

philmywallet
New Contributor III

Set Analysis - Variable within the previous 30 days

Hi  I have created a set analysis, where I only want to include a sum of the FTE if the stage in in Authorisation and the Modification date is within the previous 30 days.  It works fine without the variable, but then returns zero when I include the variable.

I have created a variable to identify the date 30 days ago.  When I try to apply it to my set analysis it doesn't work. What am I doing wrong.

=Sum(Aggr(Sum(

{<

Recruit.Vacancy_Stage={'Authorisation'},

[Recruit.Vacancy Modified Date]={'$(>=v30DaysOld)'}

>}

Recruit.Vacancy_FTE),Recruit.empjobref))

Cheers

Phil

1 Solution

Accepted Solutions
antoniotiman
Honored Contributor III

Re: Set Analysis - Variable within the previous 30 days

Hi Phil,

maybe

=Sum(Aggr(Sum(

{<

Recruit.Vacancy_Stage={'Authorisation'},

[Recruit.Vacancy Modified Date]={'>=$(=v30DaysOld)'}

>}

Recruit.Vacancy_FTE),Recruit.empjobref))

Regards,

Antonio

4 Replies
antoniotiman
Honored Contributor III

Re: Set Analysis - Variable within the previous 30 days

Hi Phil,

maybe

=Sum(Aggr(Sum(

{<

Recruit.Vacancy_Stage={'Authorisation'},

[Recruit.Vacancy Modified Date]={'>=$(=v30DaysOld)'}

>}

Recruit.Vacancy_FTE),Recruit.empjobref))

Regards,

Antonio

Re: Set Analysis - Variable within the previous 30 days

Or this?

=Sum(Aggr(Sum(

{<

Recruit.Vacancy_Stage={'Authorisation'},

[Recruit.Vacancy Modified Date]={'$('>=' & =v30DaysOld)'}

>}

philmywallet
New Contributor III

Re: Set Analysis - Variable within the previous 30 days

This didn't work, but eventually sorted it by changing the variable to:

v30DaysOld=Date((Today()-30))

Previously set at : v30DaysOld=(Today()-30)

Re: Set Analysis - Variable within the previous 30 days

try like below

Sum(Aggr(Sum(

{<

Recruit.Vacancy_Stage={'Authorisation'},

[Recruit.Vacancy Modified Date]={">=$(v30DaysOld)"}

>}

Recruit.Vacancy_FTE),Recruit.empjobref))