Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

cancel
Showing results for 
Search instead for 
Did you mean: 
enzazaden
Contributor III
Contributor III

Month Year previous selection

How do I realize the calculation in my straight table chart expression of column Sales (Previous period) based on filter 'Month Year'?

Filter Month Year
Jul 2013   Aug 2013   Sep 2013   Okt 2013   Nov 2013   Dec 2013   Jan 2014   Feb 2014   Mar 2014   Apr 2014   May 2014

Sales

October 2013 - March 2014

Sales (Previous period)

October 2012 - March 2013

10001600
15001400
30003900
50004500

Expression Sales column (Oct 2013 - Mar 2014):               Expression Sales Previous period (Oct 2012 - Mar 2013):              

sum(_sales_amount)                                                           ??

1 Solution

Accepted Solutions
enzazaden
Contributor III
Contributor III
Author

8 Replies
Gysbert_Wassenaar

Can you post a small qlikview document that demonstrates the problem?


talk is cheap, supply exceeds demand
miguelbraga
Specialist III
Specialist III

Hi Enza,

It seams you are trying to get the same period of the previous year. If so, you can do it by doing like this:

??:

sum({$<PerdiodID=, Year= {$(= max(Year-1))} >} _sales_amount)

Maybe this helps you

Regards,

MB

enzazaden
Contributor III
Contributor III
Author

Thanks for your fast reply.

We are using the 'Month Year' filter for seasons selections: October 2013 - March 2014 or

November 2013 - December 2013 AND February 2014 -March 2014

I think your code will not work because of the code 'max(Year-1)' in it.

It only will selects the periods 2014 - 1.

Please correct me if I'm wrong.

enzazaden
Contributor III
Contributor III
Author

I will make a demonstration, but I need more time for this.

miguelbraga
Specialist III
Specialist III

You need to get a field with the year, and then make your selection as equal as your Filter Month Year. The Year field must be correlated with the Month Year field

enzazaden
Contributor III
Contributor III
Author

I posted a Excel document. Hope you understand everything!

enzazaden
Contributor III
Contributor III
Author

Sorry, I don't understand your reaction. Will you post an example?

enzazaden
Contributor III
Contributor III
Author