Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

RutiTaumanRubin
Contributor

Issue with num function in if conditional

Hi,

I have the following measure in extension Simple KPI:

if(GetFieldSelections([Type])='Percent',

num(count(distinct APP_ID)/100,'#,##0%')

,num(count(distinct APP_ID),'#,##0')

)

I defined the number formatting as measure expression , but the percent doesn't work

If i just write num(count(distinct APP_ID)/100,'#,##0%') - not in if conditional -  it works..


Could you please advise?


Thank you!

Ruti

14 Replies

Re: Issue with num function in if conditional

What do you get when you use it within the if condition and outside of if condition?

RutiTaumanRubin
Contributor

Re: Issue with num function in if conditional

Hi,

With if condition -  27

Without  if condition - 27 %

Re: Issue with num function in if conditional

Are you sure the Type = 'Percent'?

RutiTaumanRubin
Contributor

Re: Issue with num function in if conditional

Yes, even I write :

if(1=1, num(count( APP_ID),'#,##0%'))

it doesn't work..

ychaitanya
Contributor III

Re: Issue with num function in if conditional

Have you tried with Standard KPI Object and not your extension ?

It worked in normal  KPI Object for me , if it didn't work in extension , there seems to be some issue with Extension standard defaulting of the Object

RutiTaumanRubin
Contributor

Re: Issue with num function in if conditional

Thank you for your help!

It's work for me in the standart KPI but I need background to the object and I don't have it in the standard KPI...

ychaitanya
Contributor III

Re: Issue with num function in if conditional

Can you try calculating the count()/100 and concatenating % , May be that would help ?

RutiTaumanRubin
Contributor

Re: Issue with num function in if conditional

I have tried this option but it didn't work...

Digvijay_Singh
Honored Contributor III

Re: Issue with num function in if conditional

Looks like a bug to me, try using variable for '#,##0%', something like $(vPercentFormat).