Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

jayeshmule
New Contributor II

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.

1 Solution

Accepted Solutions
shraddha_g
Honored Contributor III

Re: Number formatting based on the condition

Try,

if(

Count(TestcaseId) >= 10000,

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

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

)

19 Replies
agigliotti
Honored Contributor II

Re: Number formatting based on the condition

what you asking for which chart object in Qlik Sense ?

jayeshmule
New Contributor II

Re: Number formatting based on the condition

its for Line Graph Chart

agigliotti
Honored Contributor II

Re: Number formatting based on the condition

I guess you can't.

diego_a_barboza
New Contributor III

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.##', '.' , ',' )

)

jayeshmule
New Contributor II

Re: Number formatting based on the condition

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

img1.png

shraddha_g
Honored Contributor III

Re: Number formatting based on the condition

Try,

if(

Count(TestcaseId) >= 10000,

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

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

)

MVP
MVP

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)

)

sumanta12
Contributor II

Re: Number formatting based on the condition

Please try with this

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

vikasdesai
New Contributor III

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