Discussion Board for collaboration related to Creating Analytics for QlikView.
I have derived one metrics in report.
Sales growth=(current sales-prev sales)/(prev sales)
In report current and prev values are same. So ideally it should display 0.0%
But it is displaying -0.0%.
There should not be any sign for 0 value.
Please find the attached image.
Thanks in Advance !!!
if you make these numbers to two decimal, there could be difference.
please check and let us know
Go to Numbers -> Decimal -> 2 digit then it will show some fractional value it is not zero in your case.
I have checked upto 5 decimals,but values are exact same.
You can use below expression...
If(current sales = prev sales , 0, ((current sales-prev sales)/(prev sales)))
Instead of percentage in the Numbers tab, tey showing it decimals or number format.
or you can try below:
(num(current sales)-num(prev sales))/(num(prev sales))
I can't hardcode the values. Is there any other option for the same.
Or is anyone have idea that why the 0 is getting minus(-) sign.
I have tried by the same way.
I have changed the decimal format to number. But it is displaying -0.
have you used...
This is a rounding error from the floating point arithmetic. Use Round() to eliminate:
=Round((current sales-prev sales)/(prev sales), 0.1)