Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
BARC’s The BI Survey 19 makes it official. BI users love Qlik. GET REPORT
qlikdelqbz
New Contributor III

conditional number formatting as percentage in graph or kpi does not work

Hi People,

I would like to do conditional formatting of number for scatter plot and KPI. If it fits the condition match(Fin, 'IQ')<>0, then I would like the number to show as percentage like 95.6%, otherwise, just show as normal number like 95.6. Somehow, the formatting with num function does not work properly after I add If condition. It works without if condition. 

Please see my example code below:

If(
match(Fin, 'IQ')<>0,

num(Avg(
{
State4< FYear={'$(vStartYear)'}, nValue-={0}>
}
nValue)/100, '#,#%'),

Avg(
{
State4< FYear={'$(vStartYear)'}, nValue-={0}>
}
nValue)
)

Interestingly, the same formula above works in table element. 

 

Anyone can help? Thanks!

8 Replies
Channa
Valued Contributor III

Re: conditional number formatting as percentage in graph or kpi does not work

try below

 

If(
Fin= 'IQ' and  Fin <>0,

num(Avg(
{
State4< FYear={'$(vStartYear)'}, nValue-={0}>
}
nValue)/100, '#,#%'),

Avg(
{
State4< FYear={'$(vStartYear)'}, nValue-={0}>
}
nValue)
)

Channa
qlikdelqbz
New Contributor III

Re: conditional number formatting as percentage in graph or kpi does not work

Hi Channa,
thanks for your reply. But it still does not work.
It only works without if condition, like

num(Avg(
{
State4< FYear={'$(vStartYear)'}, nValue-={0}>
}
nValue)/100, '#,#%')

As long as I add if condition, the number format stops working.
Channa
Valued Contributor III

Re: conditional number formatting as percentage in graph or kpi does not work

IF( FIN='IQ' ,num(Avg(
{
State4< FYear={'$(vStartYear)'}, nValue-={0}>
}
nValue)/100, '#,#%'),

 

Avg(
{
State4< FYear={'$(vStartYear)'}, nValue-={0}>
}
nValue))

 

is it possible to share sample QVF

Channa
qlikdelqbz
New Contributor III

Re: conditional number formatting as percentage in graph or kpi does not work

Hi Channa, i have already tried this one. It also does not work for me. 😞
mbrouwer
New Contributor II

Re: conditional number formatting as percentage in graph or kpi does not work

We are facing the same problem. Any ideas or solution will be appreciated

lanlizgu
Contributor III

Re: conditional number formatting as percentage in graph or kpi does not work

What is the output of '$(vStartYear)' in each element?

lanlizgu
Contributor III

Re: conditional number formatting as percentage in graph or kpi does not work

It is working for me

 

Could you please share the .qvf?

What version are you suing?

qlikdelqbz
New Contributor III

Re: conditional number formatting as percentage in graph or kpi does not work

Hi, I was using Qlik Sense Nov 2018 Version. The number format does not work in graph. Which version are you using?