Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Please visit COVID-19 group to keep up the discussion. GO TO GROUP
Highlighted
Contributor II

last 6 months data as Dimension Qlik sense

I have 2 years of data, and i am creating one Pivot Table where

            Category is Row,

           Month from date('MM/DD/YYYY') is Column and

           sum(amount) is measures.

 

I need to see last 4 months from the Report Running date or selecting a date from filter, Please help how to show only 4 Months data in Pivot Table.

 

Thanks,

6 Replies
Highlighted

Re: last 6 months data as Dimension Qlik sense

Would you be able to provide a sample to help you better?
Highlighted
Contributor II

Re: last 6 months data as Dimension Qlik sense

Sorry, I cant able to provide sample.

I just need a column expression for getting 4 Months data from 2 yrs data.

Thanks,

Highlighted
Partner
Partner

Re: last 6 months data as Dimension Qlik sense

change ur measure from 

sum(Value) 

 

to sum({<Date={"<=$(=date(max(Date),'MM/DD/YYYY'))>=$(=date(monthstart(addmonths(max(Date),-5)),'MM/DD/YYYY'))"}>}Value)

Highlighted
Valued Contributor II

Re: last 6 months data as Dimension Qlik sense

I added a column to my calendar to make this easy and flexible....
Round((num(monthstart(Today(1))-num(monthstart(Date(TempDate)))))/30) AS MonthsFromCurrent
Then in your set expression is just
Sum({$<MonthsFromCurrent={"<5"}>} Value)
Highlighted
Contributor II

Re: last 6 months data as Dimension Qlik sense

this is working, But when selecting the particular month, the data in dashboard should change accordingly.

If i am selecting the month September in filter pane the result should be last 6 months from September(Apr,May,June,july,August& September data).

Help me to achieve this.

Highlighted
Valued Contributor II

Re: last 6 months data as Dimension Qlik sense

Something like this (untested):
Sum({$<MonthsFromCurrent={">$(Max(=MonthsFromCurrent))<$(=Max(MonthsFromCurrent)+6)"}>} Value)