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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

In Script - group percentage values

Hi,

My data contain five different records to express a percentage value. for instance:

MyTable

Load Id,

          red.perc,

          yellow.perc,

          blu.perc,

          ...

FROM ....

red.perc, yellow.perc and blu.perc are float numbers such that red.perc+yellow.perc+blu.perc=1

I would then like to create a pie chart that has as dimension the colors and has expression the average of each one.

Which solution would you suggest?

1 Solution

Accepted Solutions
Not applicable
Author

Hi Giusy,

you can load your values like this:

Table

Load Id,

          'RED' AS COLOR_NAME

          red.perc AS PERC

          ...

FROM ....

JOIN

Load Id,

          'BLUE' AS COLOR_NAME

          blue.perc AS PERC

          ...

FROM ....

then you can use the pie chart, with "COLOR_NAME" as dimension, and AVG(PERC) as expression.

View solution in original post

2 Replies
Not applicable
Author

Hi Giusy,

you can load your values like this:

Table

Load Id,

          'RED' AS COLOR_NAME

          red.perc AS PERC

          ...

FROM ....

JOIN

Load Id,

          'BLUE' AS COLOR_NAME

          blue.perc AS PERC

          ...

FROM ....

then you can use the pie chart, with "COLOR_NAME" as dimension, and AVG(PERC) as expression.

maxgro
MVP
MVP

a dimensionless pie chart with five avg(...) expressions

1.png