Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Easy Division in Script


Hi,

I have the script that follows:

SET ThousandSep='.';
SET DecimalSep=',';

LET  vNum= num(83.16);

LOAD
num($(vNum),'#.##0,00')/4 as number
AUTOGENERATE(1);

I got in number 20,75. But I should get 20,79!

Does anyone knows whats wrong?

Thanks!

Labels (1)
1 Solution

Accepted Solutions
chematos
Specialist II
Specialist II

Try this:

LET  vNum= num#(83.16, '#.##0,00');

LOAD

num#(($(vNum)/4),'#.##0,00') as number

AUTOGENERATE(1);

vNum was being rounded to 83, that was happening.

Regards,

Jose

View solution in original post

2 Replies
chematos
Specialist II
Specialist II

Try this:

LET  vNum= num#(83.16, '#.##0,00');

LOAD

num#(($(vNum)/4),'#.##0,00') as number

AUTOGENERATE(1);

vNum was being rounded to 83, that was happening.

Regards,

Jose

Not applicable
Author

Thanks!

That small difference between num() and num#() its what I need.