Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 martynlloyd
		
			martynlloyd
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		I have an expression:
({$<Domain={'Sales'}, [Dealer Type]={'SSP'}, [KPIID]={'S10','S11A','S11B'}, KPIYear={2013, 2014}>} Result)
I have a field CurrentYear, and I want to use CurrentYear-1 and CurrentYear instead of the fixed values, please can you help me get the correct syntax?
 
 martynlloyd
		
			martynlloyd
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Thanks everyone, I've solved it by creating two variables: vCurrentYear, vPreviousYear
Sum({$<Domain={'Sales'}, [Dealer Type]={'SSP'}, [KPIID]={'S10','S11A','S11B'}, KPIYear={$(vPreviousYear), $(vCurrentYear)}>} Result)
Regards,
Marty.
 
					
				
		
 michael_maeuser
		
			michael_maeuser
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		is it a variable? then you can do like this sum({<year={'$(CurrentYear)-1'}>} value)
 
					
				
		
 senpradip007
		
			senpradip007
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Try this:
vMaxYear=Max(KPIYear)
Sum({$<Domain={'Sales'}, [Dealer Type]={'SSP'}, [KPIID]={'S10','S11A','S11B'}, KPIYear={$($(vMaxYear)-1)), $(vMaxYear)}>} Result)
 
					
				
		
1st if there is only one current year this value should be store in a variable not field. so you can use the variable with $(). your case will be Year = { $(CurrentYear) }.
If your current year is a a field for some reason. I think you should use P(). Year = P({$} [Current Year])
 
					
				
		
 VishalWaghole
		
			VishalWaghole
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi Martyn,
Try this,
sum({$<Domain={'Sales'}, [Dealer Type]={'SSP'}, [KPIID]={'S10','S11A','S11B'}, KPIYear={'$(CurrentYear)-1',{'$(CurrentYear)'}}>} Result)
 martynlloyd
		
			martynlloyd
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Thanks, but this still gives a syntax error (red underline) and only returns the current year.
 martynlloyd
		
			martynlloyd
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Thanks, but this still gives a syntax error (red underline).
 martynlloyd
		
			martynlloyd
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Thanks everyone, I've solved it by creating two variables: vCurrentYear, vPreviousYear
Sum({$<Domain={'Sales'}, [Dealer Type]={'SSP'}, [KPIID]={'S10','S11A','S11B'}, KPIYear={$(vPreviousYear), $(vCurrentYear)}>} Result)
Regards,
Marty.
