Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
RutiTaumanRubin
Creator
Creator

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
Anil_Babu_Samineni
MVP
MVP

Why can't you simply use this?

if(Type='Percent', num(count(distinct APP_ID)/100,'#,##0%'),num(count(distinct APP_ID),'#,##0'))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
RutiTaumanRubin
Creator
Creator
Author

Thank you for your response.

It doesn't work in if condition even when I try to write:

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

without if condition it works...


I see that the problem exists in the extension Simple KPI ...

RutiTaumanRubin
Creator
Creator
Author

Thank you for your response..

I dont really understand how to use it ..

Anil_Babu_Samineni
MVP
MVP

If(1=1, ...) What this condition do? Just to know? Do you try mine?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
RutiTaumanRubin
Creator
Creator
Author

It doesn't do anything.. just to prove that the problem happend in if condition...