Skip to main content
Solved

New Studio: Table component "calculate share in percentages"

  • November 26, 2024
  • 2 replies
  • 149 views

thomas.keim
Level 10
Forum|alt.badge.img+2

Hello Community,

I'm currently migrating my analyses to the new views and have encountered a “problem”. I hope you can help me solve it:

Within “Analysis” the table component has the function “calculate share in percentages”.

Hee it is possible to calculate the percentage of a column per line, also what percentage of the total for a column a line represents.

How does it work in the new views?

Thank you so much for help.

Best, Thomas

 

 

Best answer by Sakura Hayashi

Hi Thomas,

 

In the new Views, the “Calculate share in percentage” option is not directly supported. However, you can achieve the same functionality using PQL.

 

1. After adding the Table component to your View, add a new column.

2. Use the following PQL expression to calculate the percentage share:

SUM("table"."column") / GLOBAL(SUM("table"."column"))

To display the result as a percentage, make sure to change the format of the column to Percentage (%).

 

Hope this helps!

2 replies

Forum|alt.badge.img+1
  • Level 5
  • 9 replies
  • Answer
  • November 27, 2024

Hi Thomas,

 

In the new Views, the “Calculate share in percentage” option is not directly supported. However, you can achieve the same functionality using PQL.

 

1. After adding the Table component to your View, add a new column.

2. Use the following PQL expression to calculate the percentage share:

SUM("table"."column") / GLOBAL(SUM("table"."column"))

To display the result as a percentage, make sure to change the format of the column to Percentage (%).

 

Hope this helps!


thomas.keim
Level 10
Forum|alt.badge.img+2
  • Author
  • Level 10
  • 9 replies
  • December 4, 2024

Hello ​@Sakura Hayashi 

wow great - you made my day 😍

Thank you so much

Best Thomas