Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
need to compare two different years ( 2011 and 2010) using variables.
Can any one help.
tnx
After taking line chart and adding Dimension and Expression
Dimension:-Month
Previous Year
Sum({<Year = {'$(=Max(Year)-1)'}>}Sales)
And
Current Year
Sum({<Year = {'$(=Max(Year))'}>}Sales)
See the snap shot of the Line chart with the Month Dimension and Expression for current and previous
SUM({<Year = {'$(=Max(Year))'}>}Sales) //Current Year
and
SUM({<Year = {'$(=Max(Year)-1)'}>}Sales) // Previous Year
Now you can compare them
Write a variable like
let vCurrYear = 2011
Let vPrevYear = 2010
and in expression use this variavbles
Update now check
If you want to compare only 2011 and 2010
then write
2011
Sum({<Year = {'$(=Max(Year)-3)'}>}Sales)
And
2010
Sum({<Year = {'$(=Max(Year)-4)'}>}Sales)
Thanks .
But i would like to depict them on line graphs ?
Let us know your requirement with dummy data...
Thanks
i was thinking just like this :
http://community.qlik.com/blogs/qlikviewdesignblog/2014/03/03/ytd
Create a line chart
Dimension
Month
Expressions
SUM({<Year = {'$(=Max(Year))'}>}Sales) //Current Year
SUM({<Year = {'$(=Max(Year)-1)'}>}Sales) // Previous Year
So, is there anything specific there in the blog that you don't understand? Otherwise, it explains very nicely, right?
You can make chart with any dimension like
Take a line chart
Dimension :-Year ,Month
Expression1:- for 2011
Sum({<Year = {'$(=Max(Year)-3)'}>}Sales)
And
Expression2:- for 2010
Sum({<Year = {'$(=Max(Year)-4)'}>}Sales)
If you want to plot chart for current year and previous year then use
Dimension:-Month
Previous Year
Sum({<Year = {'$(=Max(Year)-1)'}>}Sales)
And
Current Year
Sum({<Year = {'$(=Max(Year))'}>}Sales)