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

Turning a formula into a % in a text box

Hi,

I have various text boxes on my dashboard with calculations  in them. I have some that are percentages but i cant format them correctly.

This is an example:

left(1-(sum({$<Metric_Part={'Num'}, Metric_Code={'RTT24'}>} Metric_Value)
/
sum({$<Metric_Part={'Den'}, Metric_Code={'RTT24'}>} Metric_Value ) )


,4 ) & '%'

Rather than 'left' what can i sue to be more accurate, i was thinking a 'round' function? and also the above calculation brings out 0.76%, when i need it to say 76%.

Thanks,

1 Solution

Accepted Solutions
jagan
Luminary Alumni
Luminary Alumni

Hi,

Format the numbers using Num() like below

=Num(1-(sum({$<Metric_Part={'Num'}, Metric_Code={'RTT24'}>} Metric_Value)
/
sum({$<Metric_Part={'Den'}, Metric_Code={'RTT24'}>} Metric_Value ) ), '#,##0.0%')


Hope this helps you.


Regards,

Jagan.

View solution in original post

7 Replies
marcus_sommer

You could use something like num(value, '#.##0,0%').

- Marcus

Not applicable
Author

Sorry - i dont understand. Where do i put that in my formula?

marcus_sommer

num(1-(sum({$<Metric_Part={'Num'}, Metric_Code={'RTT24'}>} Metric_Value)
/
sum({$<Metric_Part={'Den'}, Metric_Code={'RTT24'}>} Metric_Value ) ) , '#.##0,0%')

maxgro
MVP
MVP

If your expression (I'll call exp) is

EDIT: added 1-(...)

1- (

     sum({$<Metric_Part={'Num'}, Metric_Code={'RTT24'}>} Metric_Value)  /

     sum({$<Metric_Part={'Den'}, Metric_Code={'RTT24'}>} Metric_Value )

)

To format your expression use num function, the format could be #.##0%

num(exp, '#.##0%')


To get the right format (bold), open the number tab in a chart, try the different format and when it's correct copy the format pattern

1.png



jagan
Luminary Alumni
Luminary Alumni

Hi,

Format the numbers using Num() like below

=Num(1-(sum({$<Metric_Part={'Num'}, Metric_Code={'RTT24'}>} Metric_Value)
/
sum({$<Metric_Part={'Den'}, Metric_Code={'RTT24'}>} Metric_Value ) ), '#,##0.0%')


Hope this helps you.


Regards,

Jagan.

Not applicable
Author


Thanks - that has worked

jagan
Luminary Alumni
Luminary Alumni

Hi,

If you got the answer please close this thread by giving correct and helpful answers to the useful posts, so that it would help others in finding the answers for similar type of questions.

Regards,

Jagan.