Create a calculated field based on a multivalues controller

Hi
I have a dashboard where I have calculated like nr of surveys, agent friendliness score, revenue and others.

I want to create now a table where the user can choose which KPIs the user wants to see. I created a controller called KPI, string with multiple values, but what I´m struggling now is to create the calculated field that references to that.

I have tried ifelse and in formulas but none worked. Any ideas on what I can do? thanks

Hi @Filipa

Welcome to the community!

Can you check if the formula similar to the one discussed in the below link works for you? Here a dataset column is being compared with the parameter. You could check literal string to the value selected in the parameter.

Hi @Giridhar.Prabhu

Not sure I see a solution in that threat.

I was thinking I could do something like ifelse(‘surveys’ in ${KPI}, {surveys}, NULL) but I always get an error

hI @Filipa

It goes like this.
ifelse(in(‘surveys’, ${KPI}), {surveys}, null)

ah great, this seems to work!

1 Like

Great. Can you then mark this as the solution?

Hi @Giridhar.Prabhu I just realized that it works well expect if I select all columns, if I select all then it shows nothing, is there a solution for this?
I would I need to do something like this ?

ifelse(in(‘Incoming handled calls’, ${KPI}), sum({incoming_handled_calls}),
ifelse(in(‘All’, ${KPI},sum({incoming_handled_calls}),
NULL)), although this is not working

1 Like

Use instead of NULL for the Select All case

ifelse(in(‘Incoming handled calls’, ${KPI}), sum({incoming_handled_calls}),
ifelse(in(NULL, ${KPI},sum({incoming_handled_calls}),
NULL))