19 Replies Latest reply: Nov 15, 2017 11:59 AM by Jayesh Mule

# Number formatting based on the condition

Hi All,

I want to format below expression outcome Count(TestcaseId) such that if the Count(TestcaseId)>10000 then the value should be in format of 10k or else a normal number 10000. Eg if number is 12350 then number should be 12.35K else if it is 9999 then it should show 9999 only. Please help.

• ###### Re: Number formatting based on the condition

what you asking for which chart object in Qlik Sense ?

• ###### Re: Number formatting based on the condition

its for Line Graph Chart

• ###### Re: Number formatting based on the condition

I guess you can't.

• ###### Re: Number formatting based on the condition

Hello! Try something like this:

=if((Count(TestcaseId)/10000) >= 1,

num( Count(TestcaseId)/1000, '#,##0.##', '.' , ',' )&' K',

num(Count(TestcaseId),'#,##0.##', '.' , ',' )

)

• ###### Re: Number formatting based on the condition

This link showing K in values less than 10000 and values greater than 10k are not showing.

• ###### Re: Number formatting based on the condition

Try,

if(

Count(TestcaseId) >= 10000,

num( Count(TestcaseId)/10000, '#,##0.##', '.' , ',' )&' K',

num(Count(TestcaseId),'#,##0.##', '.' , ',' )

)

• ###### Re: Number formatting based on the condition

Try a dual value, like this

=Dual(

If(Count(TestcaseId) < 10000, Num(Count(TestcaseId)), Num(Count(TestcaseId) / 1000, '0.00K')),

Count(TestcaseId)

)

• ###### Re: Number formatting based on the condition

If(COUNT(TestcaseId) < 10000, Num(COUNT(TestcaseId)), Num(COUNT(TestcaseId) / 1000, '0.00K'))

• ###### Re: Number formatting based on the condition

Hello

use following Expression

if(

Count(TestcaseId) >= 10000,

num( Count(TestcaseId)/10000, '#,##0.##', '.' , ',' )&' K',

num(Count(TestcaseId),'#,##0.##', '.' , ',' )

)

Regards

Vikas

• ###### Re: Number formatting based on the condition

Count(TestcaseId) >= 10000

means? I get the meaning of the two last rows but don't get, what this row effects. I got a similar problem and your formular works, but I would like to set the values kind of higher for the mechanism.

• ###### Re: Number formatting based on the condition

Hi Jayesh,

use num() for formatting like below

num(count(ID),'#,##0')

Regards

Sathish