Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Not applicable

Default selection- Last 3 months

Following is the requirement  Default view should show last 3 completed months data. For example, if today’s date is 23-Oct then data of June ,July and Aug should be displayed as part of selection list box. Currently data is available for 9 months


Month-Year

May-13

Jun-13

Jul-13

Aug-13

Sep-13

Oct-13

Nov-13

Dec-13

Please suggest with an example..

Tags (1)
1 Solution

Accepted Solutions
MVP & Luminary
MVP & Luminary

Re: Default selection- Last 3 months

Hi,

I think the space in the month causing the issue, can you remove the space in month field and then use this expression

='(' & Date(Addmonths(Today(),-1),'MMMYY') & '|' & Date(Addmonths(Today(),-2),'MMMYY') & '|' & Date(Addmonths(Today(),-3),'MMMYY') & ')'

Regards,

Jagan.

14 Replies
MVP
MVP

Re: Default selection- Last 3 months

Please take the pain of ceating an example so that people here can help you out faster.

MVP
MVP

Re: Default selection- Last 3 months

Hi

You could use set analysis like

     {<Date = {">=$(=AddMonths(Today(), -3))""}>}

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable

Re: Default selection- Last 3 months

I need to implement this as part of triggers as it should work with on open sheet

MVP & Luminary
MVP & Luminary

Re: Default selection- Last 3 months

HI,

If you have a date field in you app then use this expression

=Sum({<DateDimensionName={'>=$(=MonthStart(Max(DateDimensionName), -3))<=$(=MonthEnd(Max(DateDimensionName), -1))'}, MonthDimensionName=, YearDimensionName=>} MeasureName)

OR

=Sum({<DateDimensionName={'>=$(=MonthStart(Today(), -3))<=$(=MonthEnd(Today(), -1))'}, MonthDimensionName=, YearDimensionName=>} MeasureName)

Hope this helps you.

Regards,

Jagan.

kiranmanoharrode
Contributor III

Re: Default selection- Last 3 months

Dear Sravanthi,

Go to Settings---- Document Settings------- Triggers------ Document Event Triggers-----On Open------Edit Action-----

Add----Selection-----Select in field

(Repeat this 3 times to add 3 triggers)

Enter your TextMonth Field in Field input box without = (sign) for ex.  CommonMonth   values-(APR,MAY,JUN,JUL)

then  put below expression for search string input box with = (Sign)

for 1st trigger

=(Today()=MonthEnd(Today()),Date(Addmonths(Today(),-1),'MMM'),Date(Addmonths(Today(),-2),'MMM'))

for 2nd trigger

=(Today()=MonthEnd(Today()),Date(Addmonths(Today(),-1),'MMM'),Date(Addmonths(Today(),-3),'MMM'))

for 3rd Trigger

=(Today()=MonthEnd(Today()),Date(Addmonths(Today(),-1),'MMM'),Date(Addmonths(Today(),-4),'MMM'))

Save your document and reopen it.

Regards

Kiran Rode

+91 8976977897

Not applicable

Re: Default selection- Last 3 months

Hi Kiran,

3 rd trigger is replacing previous two triggers and only one month is selected....Requirement is to select all three months.....

MVP & Luminary
MVP & Luminary

Re: Default selection- Last 3 months

Hi,

Instead of 3 triggers use on one trigger and use this expression

='(' & Date(Addmonths(Today(),-1),'MMM') & '|' & Date(Addmonths(Today(),-2),'MMM') & '|' & Date(Addmonths(Today(),-3),'MMM') & ')'


Regards,

Jagan.

Not applicable

Re: Default selection- Last 3 months

It did not work....

MVP & Luminary
MVP & Luminary

Re: Default selection- Last 3 months

Hi,

Please find attached file hope it helps you.  If it not works then attach sample file.

Regards,

Jagan.