Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
How can I in qlikview divide two decimal value in order to keep the decimal part. For example:
Value1 = 5,5
Value2 = 2,2
Value3=5,5/2,2
I have tried the following:
Value3 = Value1/Value2: does not work, does not return a valid result;
Value3 = div(Value1,Value2): does not work, returns only the Integer part of division, in this case 2
Can anyone help?
Thank you!
Are you sure that your numbers use comma instead of dot?
Have you tried: 5.5/2.2
... but where have you tried? In an expression? in a text box?
Let me know
You must use decimal point for all numbers hardcoded in the script or in an expression. Example
Let variable = 5.5 / 2.2 ;
When you display it, you can choose to format it using a decimal comma, using the Num() function.
HIC
Well Guys I sorted the problem.
The 5.5 and 2.2 where just an example for what I was trying to do.
My final expression is: Value1/num($(Value2)))*100
and this works with the division bar '/'.
Thank your for the help!!
I suspect that you will get the same result if you try
Value1/$(#Value2)*100
Note the hash - it forces a numeric expansion using decimal point.
HIC