Can we create a dynamic field wells value?

I am creating a Line graph where I have to provide X-axis, Value, Colour, & Small Multiples. I want to provide users with a dynamic selection where they can select any “Value” from a given set of columns from the dataset.

How to do it? Has someone tried this before?

Yes you can do this with parameters.

You would set up a parameter, let’s call it metric.

Then in that control you would add your columns that you want to be able to change.

Then you would make a calculated field that would alter the column based on the parameter selection.

ifelse(${metric}='Sales',{sales},${metric}='Employees',{employee_id},etc.)

Then you would use that as your value ^

2 Likes

Thanks @Max Max!

Here we are manually providing values for each selection. For example - when ‘Sales’ then {sales}, when ‘Employees’ then {employee_id}. I want this part to be automated. If in future there are addition to my metrics then I don’t have to go and update the calculated field.

Any thoughts on this?

No you would need to manually do it.

You could make a dataset that you could query to add in the possible list of selections on the control, but at the end of the day you would need to add the new column name and column field in the calculated field to have it linked.

I can mark it as a feature request.

2 Likes