Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 vhespinog
		
			vhespinog
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hello
i have the follow requirement.
Formula: Previous Month + current Month - Previous Month when Fecha Liquidacion = current Month
i used the method AsOfMonth to calc the previous month. Works fine. Then i used the follow set analysis:
RangeSum(
sum({$<
Tiempo={'Pasado'}, //Previous Month
bEsPender={1}
>} Contrato),
Sum({$<
Tiempo={'Actual'}, //current Month
bEsPender = {1}
>} Contrato),
(sum({$<
Tiempo={'Pasado'}, //Previous month when Fecha liquidacion = AsOfYear
bEsPender={1},
[Fecha Liquidacion]= {'>=$(=MonthStart(Max(AsOfYear)))<=$(=MonthEnd(Max(AsOfYear)))'}
>} Contrato)*-1)
)
if i selected a AsOfYear works fine but if selected two ore more not working. The set analysis always take the max AsOfYear
Thanks
 sunny_talwar
		
			sunny_talwar
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Check the attached
RangeSum(
sum({$<
Tiempo={'Pasado'},
bEsPender={1}
>} Contrato),
Sum({$<
Tiempo={'Actual'},
bEsPender = {1}
>} Contrato),
(Sum({$<Tiempo={'Pasado'}, bEsPender={1}>}Aggr(If([Fecha Liquidacion] >= MonthStart(Max(AsOfYear)) and [Fecha Liquidacion] <= MonthEnd(Max(AsOfYear)), Contrato), AsOfYear, [Fecha Liquidacion], %cont_id))*-1)
)
 sunny_talwar
		
			sunny_talwar
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Would you be able to share a sample where we might be able to play around with this?
Thanks,
Sunny
 vhespinog
		
			vhespinog
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Thanks Sunny
 sunny_talwar
		
			sunny_talwar
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		What do you expect to see in your chart when you have two years selected?
 vhespinog
		
			vhespinog
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		if i selected two month the set analysis take the max AsOfYear, i need take the value of the dimension
in the second image ene. 2017 should be 160
 sunny_talwar
		
			sunny_talwar
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Check the attached
RangeSum(
sum({$<
Tiempo={'Pasado'},
bEsPender={1}
>} Contrato),
Sum({$<
Tiempo={'Actual'},
bEsPender = {1}
>} Contrato),
(Sum({$<Tiempo={'Pasado'}, bEsPender={1}>}Aggr(If([Fecha Liquidacion] >= MonthStart(Max(AsOfYear)) and [Fecha Liquidacion] <= MonthEnd(Max(AsOfYear)), Contrato), AsOfYear, [Fecha Liquidacion], %cont_id))*-1)
)
 vhespinog
		
			vhespinog
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		thank you very much for your help.
