How can i change aggregation of a column in "graph view" based on filter?

I created a vertical bar graph as below with filters and columns as shown :


Based on filter value i want to change the aggregation of the metrics_value ,
if i select “footfall” it should be metrics_value(max),
if i select “projected GMS Uplift” it should be metrics_value(sum),
if i select "project conversion uplift " it should be metrics_value(avg)
and so on …
Is there any way to achieve this result ?

Hello @prabhat_yadav !

You will have to create a calculated field for this. You won’t be able to dynamically change the field well aggregation.

I would recommend something like this:

ifelse(
${choiceParam} = “footfall”, max(metrics_value), 
etc..., 
NULL)

Let me know if that works!

2 Likes

pls explain choiceParam here

Hi @manaverm,
In regard to your last question…you’ll have to create a custom parameter that has the options you’d like to select listed out (i.e. footfall, projected GMS uplift, etc.). Once you’ve created that parameter, you’ll then use it in your ifelse calculated field (like Duncan pointed out above) and the ‘choiceParam’ that you reference in the calculated field will be the custom parameter you made with those listed options. So it may not be ‘choiceParam’, it would be whatever you name that parameter.

Let me know if that makes sense or if you have any additional questions.

Thank you!

1 Like

Hi @prabhat_yadav,
Since it’s been awhile since we last heard from you, I’ll go ahead and mark the solution. However, if you have any additional questions, feel free to create a new topic in the community and link this discussion for relevant information.

Thank you!