Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Not applicable

Expression returning wrong result

Hi,

Does anybody ever seen this problem?

Expression:

num([Valor Conta 2],'0.0') - rangesum(num([Valor Recebido 2],'0.0'),num([Valor Glosa 2],'0.0'),num([Valor Perda 2],'0.0'),num([VL_PAGO_RETORNO 2],'0.0'),num([VL_GLOSADO_RETORNO 2],'0.0'))

or

2266,15 - (2142,24+123,91) = 4,54747350..... should be zero!

1 Solution

Accepted Solutions
mov
Esteemed Contributor III

Re: Expression returning wrong result

Maybe using round().  And no need for num() for each part, it is only for presentation but doesn't change underlying values.


round(
[Valor Conta 2] - rangesum([Valor Recebido 2], [Valor Glosa 2], [Valor Perda 2], [VL_PAGO_RETORNO 2], [VL_GLOSADO_RETORNO 2])
,0.01)

4 Replies
mov
Esteemed Contributor III

Re: Expression returning wrong result

It is close enough to 0 - see this "e-013"

Not applicable

Re: Expression returning wrong result

The problem is that I have some conditions that depend on this result.

Do you have any tips on how to fix this?

mov
Esteemed Contributor III

Re: Expression returning wrong result

Maybe using round().  And no need for num() for each part, it is only for presentation but doesn't change underlying values.


round(
[Valor Conta 2] - rangesum([Valor Recebido 2], [Valor Glosa 2], [Valor Perda 2], [VL_PAGO_RETORNO 2], [VL_GLOSADO_RETORNO 2])
,0.01)

Not applicable

Re: Expression returning wrong result

Hi,

Try rounding to something reasonable.

Round(num([Valor Conta 2],'0.0'),0.001) -Round(rangesum(num([Valor Recebido 2],'0.0'),num([Valor Glosa 2],'0.0'),num([Valor Perda 2],'0.0'),num([VL_PAGO_RETORNO 2],'0.0'),num([VL_GLOSADO_RETORNO 2],'0.0')),0.001)

Community Browser