Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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!
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)
)
I think that's due to your data model.
Create a table box with the four fields involved:
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?
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?
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)
)
I understand now the formula thank you swuehl