Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
We value your feedback – take our 5-minute QlikView modernization survey
cancel
Showing results for 
Search instead for 
Did you mean: 
afbraga1
Creator
Creator

Duplicate values on listbox

Hi,

I am having issues with interval match in which documents are disappearing because the value being interval matched is not fitting in the interval, when in reality it should. Doing some debug I got faced with this situation which I don't know if it has anything to do with it yet, but doesn't make sense to me anyway. The field TESTE shows repeatedly the same value "0,8", when it should only show once. TESTE formula in the script is: fabs(alt(#Net_Euro/#TargetValue.Eur,1)). Any idea on what might be going on?

Thank you.

Best regards,

André

afbraga1_0-1623837217788.png

 

Labels (1)
1 Solution

Accepted Solutions
MarcoWedel

Hi,
the quotients you are calculating are slightly different from 0.8 thus generating different field values, even if the text representation is 0.8 in all cases:

MarcoWedel_0-1623891462602.png


So one solution might be to round the result e.g. like this:

fabs(Alt(Round(#Net_Euro/#TargetValue.Eur,0.000001),1)) as TESTE

hope this helps

regards

Marco

View solution in original post

3 Replies
MarcoWedel

Hi,
the quotients you are calculating are slightly different from 0.8 thus generating different field values, even if the text representation is 0.8 in all cases:

MarcoWedel_0-1623891462602.png


So one solution might be to round the result e.g. like this:

fabs(Alt(Round(#Net_Euro/#TargetValue.Eur,0.000001),1)) as TESTE

hope this helps

regards

Marco

afbraga1
Creator
Creator
Author

Hey,

In fact that was one thing I ended up doing to fix it.

Thanks for your response Marco, now I know there's someone out there who would agree with the same solution.

I just wanted to understand, if it was me doing something wrong or a bug, because I was using windows calculator and it was giving me 0,8 in all quotients and I was left very confused. In the end the calculator was fooling me. 🙂

Best regards,

André

 

MarcoWedel

Yes, windows calculator does not seem to calculate enough decimal places in this case.

Calculating the difference of two results you can however trick QlikView into showing that those results are not equal:

MarcoWedel_0-1623960531382.png

Regarding the precision of numerical values see also


https://community.qlik.com/t5/Knowledge-Base/Decimal-Values-In-Qlik-Sense-And-QlikView-April-2019-an...

https://community.qlik.com/t5/Knowledge-Base/Decimal-Values-In-Qlik-Sense-And-QlikView-June-2019-and...

https://community.qlik.com/t5/Knowledge-Base/Decimal-Values-Get-Incorrectly-Rounded/ta-p/1712865

 

hope this helps

regards

Marco