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

% Text format => 100% but 95,25% if less

Hi,

I'd like to format some percentages in text boxes on my dashboard in the following way:

if it's 100% => 100% (full integer)

if it's 0% => 0% (full integer)

if different => 95,25% (doubles with 2 decimals)

but now I only achieve the one or the other with '#.##0,00%'.

Is it possible?

1 Solution

Accepted Solutions
marcus_sommer

Try something like this:

num(0.9525, if(frac(0.9525) = 0, '0%','0,00%'))

- Marcus

View solution in original post

5 Replies
sunilkumarqv
Specialist II
Specialist II

can you provide sample Doc

MK_QSL
MVP
MVP

IF(YourExpression=1 or YourExpression=0,NUM(YourExpression,'#0'),NUM(YourExpression,'#0.00%'))

SergeyMak
Partner Ambassador
Partner Ambassador

It's possible. Use the following expression

IF(Sum(Filed)=1 OR Sum(Filed)=0, Num(Sum(Filed),'#,##0%'), Num(Sum(Filed),'#,##0.00%') )

Regards,
Sergey
marcus_sommer

Try something like this:

num(0.9525, if(frac(0.9525) = 0, '0%','0,00%'))

- Marcus

Not applicable
Author

Then I guess the frac() option is slightly more maintenance proof.

Thanks.