Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
jjustingkm
Creator II
Creator II

Shorten the Amount with dollar sign

I am looking for a custom expression format to handle the large numbers which also fits for small numbers (with B,M,K etc.)  depending on the value in the KPI, I think this is happening when I choose the number formatting Auto, but I am not getting the dollar symbol here, but number formatting money it displays the entire number.

Labels (1)
1 Solution

Accepted Solutions
seanbruton

Hi, 

This is a very easy fix and you can still use auto with a simple expression. The problem with your field is that it is not classed, tagged or formatted correctly.

 You will find that in your data model the field is tagged as interger or numeric not money. So to fix this do the following:
1. In your Data Load Editor main section make sure the currency is set correctly eg: 
SET MoneyFormat='£#,##0;-£#,##0';
2. When loading in your script format the field with money eg:

money(Sales) as Sales

The preview data will now show £123.45 insead of 123.45

Thats about it.



 

View solution in original post

3 Replies
Nagaraju_KCS
Specialist III
Specialist III

may be this will work - try this

$#,##0.00,"B";$#,##0.00,"M";$#,##0.00,"K";$#,##0.00

Chanty4u
MVP
MVP

Try this 

=if(Abs(Sum(Sales)) >= 1000000000,

     '$' & Round(Sum(Sales) / 1000000000, 1) & 'B',

if((Sum(Sales)) >= 1000000,

     '$' & Round(Sum(Sales) / 1000000, 1) & 'M',

if((Sum(Sales)) >= 1000,

     '$' & Round(Sum(Sales) / 1000, 1) & 'K',

     '$' & Round(Sum(Sales),

1)

)))

seanbruton

Hi, 

This is a very easy fix and you can still use auto with a simple expression. The problem with your field is that it is not classed, tagged or formatted correctly.

 You will find that in your data model the field is tagged as interger or numeric not money. So to fix this do the following:
1. In your Data Load Editor main section make sure the currency is set correctly eg: 
SET MoneyFormat='£#,##0;-£#,##0';
2. When loading in your script format the field with money eg:

money(Sales) as Sales

The preview data will now show £123.45 insead of 123.45

Thats about it.