Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join us at the Cloud Data and Analytics Tour! REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Integer division by 100 generating more than two decimal places

Hello everyone,

I'm importing via script data from a fixed-size TXT file where the columns with numbers have 18 digits (16.2).

The first digit can be 0 or - and the last two digits of the number represent the decimal value.

For example:

000000000000010050 in the text file is equal to 100.50

-00000000002090900 In the text file is equal to -20,909.00


In Excel I just import the file and divide by 100 the value of the columns thus arise decimals.

In QlikView, however, there were some problems due the size of the field = 18 digits.

After some search in the community  I´ve found a way to do it:

Num(Evaluate (Number)) / 100

But after using the expresion above, I get more than two decimals places.

For example:

Num (Evaluate (000000000002294097)) / 100  results in 22940.97

However if we go to number tab and change the decimals to 14 we can see more than two decimals: 22940.97000000000100.

Pending the solution

Best regards,

Sergio

1 Solution

Accepted Solutions
swuehl
MVP
MVP

I don't think that's an issue, what you see is due to the fact that some floating point numbers can't be stored 100% correct in binary representation.

You can read more about this e.g. here:

Rounding Errors

View solution in original post

2 Replies
swuehl
MVP
MVP

I don't think that's an issue, what you see is due to the fact that some floating point numbers can't be stored 100% correct in binary representation.

You can read more about this e.g. here:

Rounding Errors

View solution in original post

Not applicable
Author

Thanks! I´m trying now to solve this situation with a function.