Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
vivian_kta
New Contributor III

Conditionally format numbers

Hi members,

I need to format the value of expressions in a pivot table conditionally. I.e if the expression returns a value >100, I want to show 5 digits after decimal. Vice versa, it shows 6 digits.

I see that the Number formatting in Properties doesn't have option for this. Does anyone have any idea?

7 Replies
tush
Contributor II

Re: Conditionally format numbers

Hi Vivian,

               Please try below expression:

=if (Sum(Profit)>100,num(Sum(Profit),'#0.00000'),num(Sum(Profit),'#0.000000'))


Note : Replace Profit with you actual field.

thiago_justen
Valued Contributor III

Re: Conditionally format numbers

You could try format the expression output as follow:

If (YourExpression>100,

Round(YourExpression,0.00001),

Round(YourExpression,0.000001))

Thiago Justen Teixeira Gonçalves
WhatsApp: 24 98152-1675
Skype: justen.thiago
vivian_kta
New Contributor III

Re: Conditionally format numbers

Hi Tushar,

I tried this but it doesn't work. I guess perhaps because of the format. However I cannot post the formula here due to confidentiality. Can I have your email?

vivian_kta
New Contributor III

Re: Conditionally format numbers

Hi Thiago, I applied your solution but it didn't work.

thiago_justen
Valued Contributor III

Re: Conditionally format numbers

Could you please. post your expression?

Thiago Justen Teixeira Gonçalves
WhatsApp: 24 98152-1675
Skype: justen.thiago
vivian_kta
New Contributor III

Re: Conditionally format numbers

Hi Thiago,

Cannot post it here due to confidentiality. If possible can I have your email?

thiago_justen
Valued Contributor III

Re: Conditionally format numbers

Skype: justen.thiago

Email: thiago.justen@ultransportes.com.br

Thiago Justen Teixeira Gonçalves
WhatsApp: 24 98152-1675
Skype: justen.thiago