Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi team,
I have a sheet with four columns: Age, Gender, Ethnicity, Population count. I want to create a grid chart where one has the population count as the dimension and then would like to have a drop down altering the graph when selecting age, gender or ethnicity. Would appreciate the help.
Regards
1) Create a variable by clicking the icon in the lower left when the assets frame is open. Just name it, it doesn't have to have a function. I'm just naming mine 'variable'
2) Use the "Variable input" object, which sets the value of a variable, and can be made into a dropdown list. Choose your variable as "name", and under values use "Fixed value" and assign the names you want, such as Age, Gender, Ethnicity. I am also assuming that your table columns are called something similar, like [Age], [Gender], [Ethnicity]
3) In the chart, under data, set the dimension with a function. Something like =if(variable='Age', [Age], if(variable='Gender',[Gender], if(variable='Ethnicity',[Ethnicity])))
4) In the same area, set the label to a similar function so it displays the name of the dimension: =if(variable='Age', 'Age', if(variable='Gender','Gender', if(variable='Ethnicity','Ethnicity')))
This will require tweaking to your exact case but is generally how to alter the chart by a variable.