Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
jarrad_murray
Contributor III
Contributor III

Calculated Dimension help

Hi All,

I have an if statement with an embedded number function to display a dimension as either an integer or a percentage.  The code that I am using for this is =if(metrics_Number_or_percent='PERCENT',num(metrics_target,'#,##0%'),num(metrics_target,'#,##0')).

The problem that I am facing is that a couple of the figures that should be coming out as numbers are coming through as percentages.

Does anyone know if I am doing something wrong and/or how to fix this.

Many thanks

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Probably a bug. Try as a workaround adding a small fraction:

=if(metrics_Number_or_percent='PERCENT',num(metrics_target,'#,##0%'),num(metrics_target+0.00000000001,'#,##0'))


talk is cheap, supply exceeds demand

View solution in original post

6 Replies
Gysbert_Wassenaar

That's sounds somewhat familiar, but could be unrelated. Can you post a sample document?


talk is cheap, supply exceeds demand
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     Make sure that for those figures which are showing in percentages, not having the metrics_Number_or_percent = 'PERCENT' value.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
rathnam_qv
Creator
Creator

Hi,

try this one....

=If(metrics_Number_or_percent='PERCENT',num(metrics_target,'#,##0%'),num(metrics_target,'#,##0')),

metrics_Number_or_percent)

jarrad_murray
Contributor III
Contributor III
Author

Many thanks for your reply,

Please find attached an example file of what I am trying to achieve.

Gysbert_Wassenaar

Probably a bug. Try as a workaround adding a small fraction:

=if(metrics_Number_or_percent='PERCENT',num(metrics_target,'#,##0%'),num(metrics_target+0.00000000001,'#,##0'))


talk is cheap, supply exceeds demand
jarrad_murray
Contributor III
Contributor III
Author

Hi Gysbert,

That has worked. Many thanks for your help.