Forum

Imported data gets ...
 
Notifications
Clear all

Imported data gets corrupted - 5.1 becomes 5.0999999999

4 Posts
2 Users
0 Reactions
75 Views
(@paulma)
Posts: 17
Eminent Member
Topic starter
 

Hi, I'm importing data with a column for paragraph numbers, eg 7.5.13, 8.6, etc. PQ seems to recognise the first value as text and the second as a number. Occasionally, 8.6 will get corrupted and appear as 8.59999999999999999999999. I'd like to know if there's something I can do about this, that's easier than going through the whole column and manually replacing the values. Is this a bug in PQ? If this error is unavoidable, is there a function I can use to round these errors? TIA...

 
Posted : 10/03/2022 6:05 pm
(@mynda)
Posts: 4761
Member Admin
 

Hi Paul,

The problem you're discovering happens when Excel converts values to binary and back again. Sometimes referred to as a floating point.

Without seeing the structure of your file it's tricky to give a specific solution, but I would use Round to round the values to 2 decimal places.

Hope that helps. If you're still stuck, please provide a sample Excel file so we can insert the solution in the file.

Mynda

 
Posted : 10/03/2022 7:44 pm
(@paulma)
Posts: 17
Eminent Member
Topic starter
 

Thanks Mynda, I don't know if rounding to 2 decimal places would work: 5.6 would appear as 5.60, for example. At present I'm extracting from several Excel files in a folder, and from multiple sheets in each file. I tried replicating the issue from within a single file, ie, the source data and the query in the same file, but I can't replicate the error.  Paul

 
Posted : 11/03/2022 11:42 am
(@mynda)
Posts: 4761
Member Admin
 

How about rounding to 1 decimal place then?

 
Posted : 11/03/2022 7:51 pm
Share: