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: 
Anonymous
Not applicable

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
Partner - Master III
Partner - Master III

Try,

if(

Count(TestcaseId) >= 10000,

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

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

)

View solution in original post

19 Replies
agigliotti
Partner - Champion
Partner - Champion

what you asking for which chart object in Qlik Sense ?

Anonymous
Not applicable
Author

its for Line Graph Chart

agigliotti
Partner - Champion
Partner - Champion

I guess you can't.

diego_a_barboza
Creator
Creator

Hello! Try something like this:

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

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

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

)

Anonymous
Not applicable
Author

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

img1.png

shraddha_g
Partner - Master III
Partner - Master III

Try,

if(

Count(TestcaseId) >= 10000,

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

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

)

jonathandienst
Partner - Champion III
Partner - Champion III

Try a dual value, like this

=Dual(

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

  Count(TestcaseId)

)

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
sumanta12
Creator II
Creator II

Please try with this

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

vikasdesai
Partner - Contributor III
Partner - Contributor III

Hello

use following Expression

if(

Count(TestcaseId) >= 10000,

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

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

)

Regards

Vikas