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

Convert number field to 2 decimal places

Hi

I have a numerical field in a table from SQL that is just expressed as numbers, e.g 25455.

However this field is a cash value that should be to 2 decimal places e.g £254.55.

I have tried to amend this using the list box properties, however it just adds more digits, e.g £25,455.00

Could someone point me in the right direction?

Thanks

15 Replies
Not applicable
Author

This is the line in my Script

LOAD "OPENING_BALANCE" = Num( "OPENING_BALANCE"/ 100, ' £###.##', '.', ',' );

SQL SELECT "OPENING_BALANCE"

FROM "XXXXXXX"

I can't open your attachment I am afraid, it fails

thanks

Anonymous
Not applicable
Author

Try

Load Num( "OPENING_BALANCE"/ 100, ' £###.##', '.', ',' ) as "OPENING_BALANCE";

SQL SELECT "OPENING_BALANCE"

FROM "XXXXXXX";

Regards

jagan
Luminary Alumni
Luminary Alumni

Hi,

Try like this

LOAD

Num( [OPENING_BALANCE]/ 100, ' £###.##', '.', ',' ) AS OPENING_BALANCE";

SQL SELECT "OPENING_BALANCE"

FROM "XXXXXXX";

Regards,

Jagan.

israrkhan
Specialist II
Specialist II

Sorry, i did not get you correctly before, now i got you correctly

LOAD "OPENING_BALANCE" = Num( "OPENING_BALANCE"/ 100, ' £###.##', '.', ',' );.... is not correct way



try this, sure it will work..

LOAD

Num( [OPENING_BALANCE] / 100, ' £###.##', '.', ',' ) as NewNum;

SQL SELECT "OPENING_BALANCE"

FROM "XXXXXXX"

Not applicable
Author

That's it! Thanks to everyone for your help, each answer was very helpful.

israrkhan
Specialist II
Specialist II

Keep posting.... and enjoy Qliking.....