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

Announcements
Join us at Qlik Connect 2026 in Orlando, April 13–15: Register Here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Round numbers (%) in expression

Hi,

I try get MAX values in bar chart for each category (picture below). I got it, but I have a problem with round numbers. May I ask for help?

This is code, which I need for MAX values in Category in %. It works fine.

=if(RANK(AGGR(Sum({<DATUM_ID = {">=$(=datum_od) <=$(=datum_do)"}>} PRIJATE)/ Sum(TOTAL <AREA> {<DATUM_ID = {">=$(=datum_od) <=$(=datum_do)"}>} PRIJATE) ,AREA, TYPE)) = 1,rgb(80,80,80))


p.s. "DATUM_ID" means DATE

1.JPG

Labels (1)
1 Solution

Accepted Solutions
sunny_talwar

Show Value just specify which value to show, but to format you either need to format your actual expression using Num() function or go to Numbers tab to format it.

Capture.PNG

Also, show value should work with this only

Rank(Sum({<DATUM_ID = {">=$(=datum_od) <=$(=datum_do)"}>} PRIJATE)/ Sum(TOTAL <AREA> {<DATUM_ID = {">=$(=datum_od) <=$(=datum_do)"}>} PRIJATE)) = 1

View solution in original post

7 Replies
sunny_talwar

You are looking to show 94,339622641509% as 94%? May be this:

Num(Sum({<DATUM_ID = {">=$(=datum_od) <=$(=datum_do)"}>} PRIJATE)/ Sum(TOTAL <AREA> {<DATUM_ID = {">=$(=datum_od) <=$(=datum_do)"}>} PRIJATE), '##%')

Or on the Number's tab of the chart properties you can select Integer and then check 'Show in Percent (%)'

Not applicable
Author

I edited my code. It is right:

=if(RANK(AGGR(Sum({<DATUM_ID = {">=$(=datum_od) <=$(=datum_do)"}>} PRIJATE)/ Sum(TOTAL <AREA> {<DATUM_ID = {">=$(=datum_od) <=$(=datum_do)"}>} PRIJATE) ,AREA, TYPE)) = 1,rgb(80,80,80))

but  Num(..., '##%') doesn't work

sunny_talwar

This code is used for background color, right?

=if(RANK(AGGR(Sum({<DATUM_ID = {">=$(=datum_od) <=$(=datum_do)"}>} PRIJATE)/ Sum(TOTAL <AREA> {<DATUM_ID = {">=$(=datum_od) <=$(=datum_do)"}>} PRIJATE) ,AREA, TYPE)) = 1,rgb(80,80,80))

You don't need formatting for color. You need this in your original expression.....

Not applicable
Author

No, it is code for Show Value.

2.JPG

swuehl
Champion III
Champion III

You would need to set the format for your expression ( Sum({<DATUM_ID = ....), not for the expression attribute 'Show Value'.

Hence add the Num() part to your original expression or set the format accordingly on number tab.

sunny_talwar

Show Value just specify which value to show, but to format you either need to format your actual expression using Num() function or go to Numbers tab to format it.

Capture.PNG

Also, show value should work with this only

Rank(Sum({<DATUM_ID = {">=$(=datum_od) <=$(=datum_do)"}>} PRIJATE)/ Sum(TOTAL <AREA> {<DATUM_ID = {">=$(=datum_od) <=$(=datum_do)"}>} PRIJATE)) = 1

Not applicable
Author

Thank you Sunny. You are right.

Show Value work only with this:

Rank(Sum({<DATUM_ID = {">=$(=datum_od) <=$(=datum_do)"}>} PRIJATE)/ Sum(TOTAL <AREA> {<DATUM_ID = {">=$(=datum_od) <=$(=datum_do)"}>} PRIJATE)) = 1


and in Number tab I add Format Pattern 0%. Now this is according to my idea.