Skip to main content
Question

How can I show the ratio after applying a specific filter?


スクリーンショット 2022-08-11 15.50.25Hi community,

 

I would like to create OLAP table which is shown in the attached pic.

 

The table includes kinds of fruits, amount, and ratio.

 

[QUestions]

How can I calculate the ratio after applying a specific filter?

 

[tried]

  • Using SUM(filter to null(amount))

 

Thank you for your support!

Forum|alt.badge.img+14

Maybe the filter can write to a variable? You could set up a variable for "Fruits". When you select values from the drop down, the filter variable is set to those values. Then your ratio can be the amount of each fruit as a percentage of "Fruits" variable?

 

You could potentially do something similar as a component filter or sheet filter.


Hi Sean!

 

Thank you for your answer!

 

I tried to set up a variable for Fruits and made it a filter.

But, it doesn't work...

The ratio does not show correctly.

*it shows 100%

 

Here is my setting for a dashboard.

 

[variable]

variable X = fruits

 

[filter]

fruits(variable X) as dropdown

 

[formula for calculating ratio]

SUM(Amount) / SUM(Amount)

 

[columns for OLAP TABLE]

fruits, Amount, ratio

 

 

 

 

 


I don't think that this is possible. You can make a new table column with the old_ratio and maybe attach it to the new table. But I don't think that this works only with PQL-Statements in the environment.


Reply