Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
gshockxcc
Creator
Creator

Problem with money/number formatting

I have US currency formatted as '1,280.00 USD' in my data report.  I have used 'PurgeChar' to remove the ' USD' from the field.  But no matter what I do to format the values as numbers/money, I can't seem to get the correct output.

I have attached a sample file.

1 Solution

Accepted Solutions
Not applicable

Purgechar is not elimanating the extra space b/n number & USD. So that causing issue. Use below expression.

left( [Closed Revenue] , len([Closed Revenue])-4)

View solution in original post

10 Replies
robert_mika
Master III
Master III

What output are you trying to achieve?

maybe just:

=Money#([Closed Revenue])

Not applicable

Hi Kristian, some how purgechar didn't remove the extra space & causing the issue. I Tried with SubField but I am not lucky. So please use the below expression & Qlikview automatically convert into after after expression evaluation.

left( [Closed Revenue] , len([Closed Revenue])-4)

gshockxcc
Creator
Creator
Author

I am trying to create a summation of the values using an Aggr function.  But when I apply that to the field, it returns nothing.  If I use "Count()", it will return the correct number of values, but Sum() will not return anything.  I assumed that this is because the field is not formatted as a number so that Qlikview can perform a summation.

When I use Money#([Closed Revenue]), Qlikview returns 1,028...

If I add another line of text below the expression, Qlikview will return 1,028.00

I don't understand what's wrong so that I can correct the formatting to do the summation.    

jonathandienst
Partner - Champion III
Partner - Champion III

Or Num(Num#(SubField([Closed Revenue], ' ', 1), '#,##0.00', '.', ','))

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
lethu281
Contributor II
Contributor II

Hi Kristan,

Have you tried to look at your default QV settings, they can possibly override your formatting, as well as the regional settings on the Server or PC that you are working from. Alternatively, you can "Trim" the data to exclude the trailing "USD".

Not applicable

Purgechar is not elimanating the extra space b/n number & USD. So that causing issue. Use below expression.

left( [Closed Revenue] , len([Closed Revenue])-4)

Not applicable

Somehow subfield didn't worked on this dataset.

gshockxcc
Creator
Creator
Author

Agreed.  I tried the Subfield() function before submitting my post, and it did not work.  Thanks for your help.

jonathandienst
Partner - Champion III
Partner - Champion III

Because it is not a space (chr(32)), but a hard space (chr(160)) - thankyou Excel

     Num(Num#(SubField([Closed Revenue], chr(160), 1), '#,##0.00', '.', ','))

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein