Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
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

1 Solution

Accepted Solutions
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"

View solution in original post

15 Replies
Anonymous
Not applicable
Author


Hi Martin,

Is that what you mean:

= Num( 25455 / 100, ' £###.##', '.', ',' )

Not applicable
Author

Hi Lucas

Looks like it yes, do I build that into my script?

thanks

Anonymous
Not applicable
Author

Yes Martin,

but instead of using the fix number 24555 just use your number field instead:

= Num( NumField/ 100, ' £###.##', '.', ',' )

Or you could use on your objects ( list, tables, etc ) as a calculated dimension.

Please tell me if you could archive it!

Regards

Not applicable
Author

Hi Lucas

I have added this to my script, but once reloaded I only end up with two values, £0.00 and £-1.00 ?

thanks

Anonymous
Not applicable
Author

Martin,

could you send me some examples of the plain number, or maybe attach the qvw?

Regads

Not applicable
Author

Sure, some example numbers below. I'm afraid I can't attach the qvw

1437185

801762

883832

32107

98106

401059

thanks

israrkhan
Specialist II
Specialist II

hi

on the number tab select money and enter the format pattern  £#,##0.00;(£#,##0.00)

will work...

Not applicable
Author

Hi Israr

Thanks for the input, I tried something similar earlier, however that just appends additional digits to the end.

for example 32107 becomes £32,107.00. I want it to be £321.07

thanks

Anonymous
Not applicable
Author

Martin, how are you using that field? it worked on a list, with your examples:

Formated.png

Please, see attached.