Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Convert text to numeric value and keep all decimals?

Some of the data are numbers, stored in text fields. When converting using:

NUM#([Text Result], '#') AS [Result]

... it can give the following results:

Capture.PNG

I want the same precision for the numeric value as the original text value, however this is not always what the code delivers. Why is the last two zeroes removed from row 4, but kept in row 2? How do I achieve what I need, what conversions are necessary?

3 Replies
Gysbert_Wassenaar

Num(NUM#([Text Result], '#'),'#.000') AS [Result]


talk is cheap, supply exceeds demand
Anonymous
Not applicable
Author

Still doesn't work:

Capture.PNG

Zeroes are sometimes still cut off.

Gysbert_Wassenaar

Works for me. See attached example


talk is cheap, supply exceeds demand