6 Replies Latest reply: Mar 18, 2015 3:06 AM by Kavita Vishwakarma

# No effect of Year and Month selection on Chart, with last 12 months data

Hi...

How can I show last 12 months with no effect of Year and Month Selection on chart, but the other filters can be selected...

Regards,

Kavita

• ###### Re: No effect of Year and Month selection on Chart, with last 12 months data

Hi Kavita,

you'll want to use set analysis within your expression for this.

Have a look at this for a good explanation of it.

http://community.qlik.com/docs/DOC-4951

if you need further help, post up an example app and can take a look

hope that helps

Joe

• ###### Re: No effect of Year and Month selection on Chart, with last 12 months data

Hi,

Suppose you want to calculate sum of sales,

then define a variable vPrev12MonthDate = Date(Addmonths(Date,-12))

then in expression of chart write:

Sum({<Date ='>=\$(=vPrev12MonthDate)<=Date',Month=,Year=,Quater=>}Sales).

• ###### Re: No effect of Year and Month selection on Chart, with last 12 months data

... or you could manually make the selection[s] for the last 12 months, and then lock the selection.

• ###### Re: No effect of Year and Month selection on Chart, with last 12 months data

Hi,

First of all, How can you select last 12 months. suppose date is 6 june 2014,

how will you select data from 7 june 2013 to 6 june 2014 ??

Second , if selection is made , then that will affect other reports, which anyone wouldn't demand.

Third,

If on every row of a chart, we need to calculate according to date in that row, then this solution will not work.

Do you agree with this ?

• ###### Re: No effect of Year and Month selection on Chart, with last 12 months data

Hi...

The below expression worked for me...

=Count({<DATE={'>=\$(=MonthStart(Max({1}DATE),-11))<=\$(=MonthEnd(Max({1}DATE)))'},FMonth=,FYear=>}Customer)

Regards,

Kavita