Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Partner
Partner

How to show last 3 months data but show values on max month

Helloo Every1,

I want to show last 3 months values, but the sum of last 3 months should show on one bar i.e maxmonth(on selection)

Example

Aug,Jul,Jun

20,10,30

sum of three months is 60, so it should be displayed on Aug bar.

I am able to get last 3 months summation, but its not displayed on desired bar i.e AUG

Regards,

Kavita

9 Replies
MVP
MVP

Re: How to show last 3 months data but show values on max month

Partner
Partner

Re: How to show last 3 months data but show values on max month

Thank you for the link....

That's for rolling 3,6 12 months...

What if I want to show the summation for the selection month and all previous month...

For an e.g: Aug 2015 is selected, I want to display from Apr till Aug 2015 values in Aug 2015 bar.

Please help!!!

Its urgent.....

garethct
Contributor

Re: How to show last 3 months data but show values on max month

This is exactly what I want to find out as well, did you manage to solve this Kavita?

Thanks

Gareth

Highlighted
admin1
New Contributor III

Re: How to show last 3 months data but show values on max month

No..But the above solution is bit helpful.

ChennaiahNallani
Contributor III

Re: How to show last 3 months data but show values on max month

=Sum({<Your MonthYear filed ={">=$(=Date(addmonths(Max(Your MonthYear filed), -2), 'MMM-YY'))"} >} Your FiledName)

garethct
Contributor

Re: How to show last 3 months data but show values on max month

Hi Kavita

I've figured it out,

count(

  {<

  YOUR_DATE = {">=$(=MonthStart(addmonths(max(YOUR_DATE),-2)))  <$(=Monthstart(addmonths(max(YOUR_DATE),1)))"}

  >}

  YOUR_UNITS)

this shows units in the last 3 months when selecting a month on a list box.

Partner
Partner

Re: How to show last 3 months data but show values on max month

Post a sample application with your logic.

garethct
Contributor

Re: How to show last 3 months data but show values on max month

Unfortunately I cannot provide sample data,

My expression works for what I am trying to do which is show the units for each buyer within the last 3 months.

I didn't just want to show the current last 3 months but a dynamic last 3 months. So if I select Jan-15 it will show me all units for Nov-14, Dec-15 and Jan-15 per buyer.

Re: How to show last 3 months data but show values on max month

try


sum(aggr(rangesum(above(total sum({<MonthYear=>}Amount),0,3)),MonthYear))