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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
mstoler
Partner - Specialist
Partner - Specialist

Display a value for a dimension with 1 decimal place

Hello,

I have a requirement to display Gloves with 1 Decimal Place and Jeans with 0 Decimal places.

Looking for some suggestions.

Thank You,

Michael

 

mstoler_0-1620832767543.png

 

1 Solution

Accepted Solutions
jwjackso
Specialist III
Specialist III

You could create a table

FMT:

load * inline[

Product,FMT

Jeans,'#.'

Gloves,'#.0'

];

Still set the Number formatting to expression,

Num(Sum(Amount),FMT)

 

View solution in original post

3 Replies
jwjackso
Specialist III
Specialist III

Set the measure "Number formatting" to Expression.  In the measure

=If(Product='Jeans',Num(Sum(Amount),'#.'),Num(Sum(Amount),'#.0'))

 

mstoler
Partner - Specialist
Partner - Specialist
Author

Hello,

That is what I thought.  

I don't like to use if statements because it may slow things down.  Is there another solution?

 

Michael

jwjackso
Specialist III
Specialist III

You could create a table

FMT:

load * inline[

Product,FMT

Jeans,'#.'

Gloves,'#.0'

];

Still set the Number formatting to expression,

Num(Sum(Amount),FMT)