Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikdelqbz
Contributor III
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!

Labels (3)
8 Replies
Channa
Specialist III
Specialist III

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
Contributor III
Contributor III
Author

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
Specialist III
Specialist III

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
Contributor III
Contributor III
Author

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

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

lanlizgu
Creator III
Creator III

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

lanlizgu
Creator III
Creator III

It is working for me

 

Could you please share the .qvf?

What version are you suing?

qlikdelqbz
Contributor III
Contributor III
Author

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