Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Limit Bar Chart to Data starting from this year

Hello all,

I have a barchart which displays month end results for an expression.

However, I would like to limit the display of the month end dimension to start from a specific month (and exclude everything before hand).

Any advice on this one?


Regards,

Myles

3 Replies
ramoncova06
Valued Contributor III

Re: Limit Bar Chart to Data starting from this year

you can use year start function

sum({<MonthEnd {">=$(yearstart(max(Date)))"}}Value)

Not applicable

Re: Limit Bar Chart to Data starting from this year

Thanks Ramon.

I did attempt this, but I already have a num function which uses avg for several steps within a cycle

=num(

if(IsNull(avg({$*<CycleType={'Step1'}, [Status]-={'CANCELLED', 'ON HOLD'}, [Flag]={'0'}, [Cycle Status]={'Actual'}>} CycleTime)), 0, avg({$*<CycleType={'Step1'}, [Status]-={'CANCELLED', 'ON HOLD'}, [Flag]={'0'}, [Cycle Status]={'Actual'}>} CycleTime)) +

if(IsNull(avg({$*<CycleType={'Step2'}, [Status]-={'CANCELLED', 'ON HOLD'}, [Flag]={'0'}, [Cycle Status]={'Actual'}>} CycleTime)), 0, avg({$*<CycleType={'Step2'}, [Status]-={'CANCELLED', 'ON HOLD'}, [Milestone.Flag]={'0'}, [Cycle Status]={'Actual'}>} CycleTime)) +

if(IsNull(avg({$*<CycleType={'Step3'}, [Status]-={'CANCELLED', 'ON HOLD'}, [Flag]={'0'}, [Cycle Status]={'Actual'}>} CycleTime)), 0, avg({$*<CycleType={'Step3'}, [Status]-={'CANCELLED', 'ON HOLD'}, [Flag]={'0'}, [Cycle Status]={'Actual'}>} CycleTime)) +

if(IsNull(avg({$*<CycleType={'Step4'}, [Status]-={'CANCELLED', 'ON HOLD'}, [Flag]={'0'}, [Cycle Status]={'Actual'}>} CycleTime)), 0, avg({$*<CycleType={'Step4'}, [Status]-={'CANCELLED', 'ON HOLD'}, [Flag]={'0'}, [Cycle Status]={'Actual'}>} CycleTime))

, '#,##0.0')

I'm not sure how I can layer this in.

ramoncova06
Valued Contributor III

Re: Limit Bar Chart to Data starting from this year

you would have to add MonthEnd {">=$(yearstart(max(Date)))"} to one of your  expression

MonthEnd and Date are dependent on who your dates fields are called