Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
vlad_komarov
Partner - Specialist III
Partner - Specialist III

Displaying negetive percentage values as (##%)


Hello all,

I need to display negative percentage values in the chart in the (##%) format (as (5%), (10%) instead of -5%, -10%).

Here is the default QV formatting:

1.png

using the '#,##0%' format string

I thought displaying negative percentage values in parenthesis should be a trivial task and I've updated the chart with the following format string '#,##0%;(#,##0%)'.

As a result values are displayed like:

2.png

I am not 100% sure how QV is using this format string, but it looks like it doubles "Show in percent %" option and divides values by 100 one more time (for negative values only).

I was hoping somebody have more elegant solution instead of using (Var *100) option for negative values in my Expression....

The closest one I've found is to use the '#,##0%;(#,##0)%' format string (% sign outside the parenthesis).

3.png

This display format is a bit un-orthodox, but at least the values are correct.

Any other solutions/suggestions? I would appreciate a feedback.

Best regards,

Vladimir

12 Replies
d_pranskus
Partner - Creator III
Partner - Creator III

Hi

Actually I came across this discussion. What I found that the simplest solution is to multiply the value in the expression and use the following text in the format: #,##0.0% ;(#,##0.0%) (Notice the space before the semicolon).

Qlikview treats the format as a percentage if it is the last character in the format.

For example

NUM((SUM(profit)/SUM(amount) -1) * 100, '#,##0.0% ;(#,##0.0%)')

The only problem I see here if this exported into Excel, it appears without percent sign or if you use the format as a setting, it shows like 25,00%.

Cheers

Darius

vlad_komarov
Partner - Specialist III
Partner - Specialist III
Author

Darius,

Thank you for reply. This solution will not work well in my case (I am using variables as expressions, which actually integrated into other charts, so multiplying all values by 100 creates few problems). And the full export functionality (with proper formatting) is critical for me as well.

Thanks for suggestion.

Regards,

Vladimir

inoruoya
Partner - Contributor III
Partner - Contributor III

Thanks for your idea  @Darius Pranskus