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
 its_anandrjs
		
			its_anandrjs
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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

 MK_QSL
		
			MK_QSL
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		SUM({<Year = {'$(=Max(Year))'}>}Sales) //Current Year
and
SUM({<Year = {'$(=Max(Year)-1)'}>}Sales) // Previous Year
Now you can compare them
 its_anandrjs
		
			its_anandrjs
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Write a variable like
let vCurrYear = 2011
Let vPrevYear = 2010
and in expression use this variavbles
 its_anandrjs
		
			its_anandrjs
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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 ?
 MK_QSL
		
			MK_QSL
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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
 MK_QSL
		
			MK_QSL
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Create a line chart
Dimension
Month
Expressions
SUM({<Year = {'$(=Max(Year))'}>}Sales) //Current Year
SUM({<Year = {'$(=Max(Year)-1)'}>}Sales) // Previous Year
 tresesco
		
			tresesco
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		So, is there anything specific there in the blog that you don't understand? Otherwise, it explains very nicely, right?
 its_anandrjs
		
			its_anandrjs
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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)
