Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 
					
				
		
 pgalvezt
		
			pgalvezt
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hello,
I´ve trying to divide (a+b)/(c+d) into set analysys within other if sentences, All if works fin (all are sum) but division gives 0,
I add a qlikview example ...
Thank you!
 
					
				
		
 swuehl
		
			swuehl
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Well, this returns 1830:
=Sum({<Factor = {'Total Cantidad','Total Valor','Total CP','Dotacion Total'}>}
If(Factor = 'Total Cantidad',Hrs.Ord.ppto+Hrs.Ext.ppto,If(Factor = 'Total Valor',[Valor_Hrs.Ext.ppto]+Valor_Hrs.Ord.ppto,
If( Factor = 'Total CP',(Valor_Hrs.Ext.ppto+Valor_Hrs.Ord.ppto)// (Hrs.Ord.ppto+Hrs.Ext.ppto)
, If(Factor = 'Dotacion Total',DotacionTotal.ppto
,0)))))
/Sum({<Factor = {'Total CP'}>}
(Hrs.Ord.ppto+Hrs.Ext.ppto)
)
 
					
				
		
 swuehl
		
			swuehl
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		I think that's due to your data model.
Create a table box with the four fields involved:
![2016-06-18 01_42_06-QlikView x64 - [C__Users_Stefan_Downloads_Test3.qvw_].png](/legacyfs/online/128371_2016-06-18 01_42_06-QlikView x64 - [C__Users_Stefan_Downloads_Test3.qvw_].png)
Your records won't show values <>0 for both the numerator and denominator of your division at the same time, so it would result in either zero or NULL, hence the sum() would be zero.
Not sure what you are trying to achieve though. Maybe use something like Sum(a+b) / Sum(c+d) instead?
 
					
				
		
 pgalvezt
		
			pgalvezt
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi,
I need to get 1830... Thats all... If I select CP Total QlikView show me 1830 in the pivot table... If I select other filter QlikView show me good too the result, I don´t know why QlikView Doesn't the same thing in Chart Object or in a indicator?
 
					
				
		
 swuehl
		
			swuehl
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Well, this returns 1830:
=Sum({<Factor = {'Total Cantidad','Total Valor','Total CP','Dotacion Total'}>}
If(Factor = 'Total Cantidad',Hrs.Ord.ppto+Hrs.Ext.ppto,If(Factor = 'Total Valor',[Valor_Hrs.Ext.ppto]+Valor_Hrs.Ord.ppto,
If( Factor = 'Total CP',(Valor_Hrs.Ext.ppto+Valor_Hrs.Ord.ppto)// (Hrs.Ord.ppto+Hrs.Ext.ppto)
, If(Factor = 'Dotacion Total',DotacionTotal.ppto
,0)))))
/Sum({<Factor = {'Total CP'}>}
(Hrs.Ord.ppto+Hrs.Ext.ppto)
)
 
					
				
		
 pgalvezt
		
			pgalvezt
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		I understand now the formula thank you swuehl
