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
I have used :
SUM({<Year = {'$(=Max(Year)-3)'}>}Sales) //2011
SUM({<Year = {'$(=Max(Year)-4)'}>}Sales) // 2014
The problem is that, i can not see both lines graphs at the same time for comparison.
Keep Month as Dimension
You are right for the st expression.
but why can not i see comparison graph like this : (I can not see it )
http://community.qlik.com/blogs/qlikviewdesignblog/2014/03/03/ytd
Exactly you not get it depends on the value in the fields in your model like month and Year values. Also after creating line chart format the line chart like click on the expression >> Display options >> Select Smooth from the options.
You need to take Monthyear Inpace of month then it will look like graph
Create monthYear field
MonthName(Date) as MonthYear and take as dimension
use same expressions as provided above posts
hope this helps
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
No need to take two expression
simply Take month and year in dimension
and expression
sum({<Year={'2010','2011'}>} Amount)
hope this helps
even expression
sum({<Year={'2010','2011'}>} Amount)
can be dynamic
like below
sum({<Year={">=$(=Max(Year))"}>}Amount)
this helps you to compare current Year Vs previous Year
hope this helps
Thanks a lot.
It worked very well
The same answer I have given long time ago !!