Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 Emil_bros
		
			Emil_bros
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi,
I need to find a formula where variable 'VERSION' changes dynamically in relation to given month.
In my case names of VERSIONS are corresponding to MONTH names (formated as data)
My formula is not working:
sum({<VERSION = {'=Month'}>} VAL)
As a result I want the formula to take value for EACH MONTH from different VERSION
 sunny_talwar
		
			sunny_talwar
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		So, you want to add the set analysis in this new expression? Try this
Sum({<COST1 = {'Net Sales'}>} If(VERSION = Month, VAL)) sunny_talwar
		
			sunny_talwar
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Not entirely sure, but may be this
Sum({<VERSION = p(Month)}>} VAL) Emil_bros
		
			Emil_bros
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		not working, error in expression
 sunny_talwar
		
			sunny_talwar
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Sorry this
Sum({<VERSION = p(Month)>} VAL) Emil_bros
		
			Emil_bros
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		thank you Sunny however now the result is a sum of all versions (please see the attached)
 Emil_bros
		
			Emil_bros
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		should be what is marked blue in attached file
 sunny_talwar
		
			sunny_talwar
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Set analysis won't work for this... try this
Sum(If(VERSION = Month, VAL)) Emil_bros
		
			Emil_bros
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		thank you it now works however I wasn't exactly clear about the data model.
I already use set analysis in the expression to calculate value:
sum({<COST1 = {'Net Sales'}>} VAL)
so to use your formula properly I need to have COST1 filter selected on "Net Sales" which is impacting my other expressions.
Is there any other way?
 sunny_talwar
		
			sunny_talwar
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		So, you want to add the set analysis in this new expression? Try this
Sum({<COST1 = {'Net Sales'}>} If(VERSION = Month, VAL)) Emil_bros
		
			Emil_bros
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Perfect! Exactly what I need. Thank you very much
