I have a parameter 'type' in a table and it can have multiple values as follows -
- human
- chimpanzee
- orangutan
I have 3 columns related to each type in the table -
- human_avg_height, human_avg_weight, human_avg_lifespan
- chimpanzee_avg_height, chimpanzee_avg_weight, chimpanzee_avg_lifespan
- orangutan_avg_height, orangutan_avg_weight, orangutan_avg_lifespan
So if i select the type as human, the quicksight dashboard should only display the three columns -
- human_avg_height, human_avg_weight, human_avg_lifespan
and should not display the following columns -
- chimpanzee_avg_height, chimpanzee_avg_weight, chimpanzee_avg_lifespan
- orangutan_avg_height, orangutan_avg_weight, orangutan_avg_lifespan
I created the parameter type and in the add calculated fields I am trying to use ifelse to select the columns based on the parameter selected as follows -
ifelse(${type}='human',{human_avg_height}, {human_avg_weight}, {human_avg_lifespan},{function})
I also tried -
ifelse(${type}='human',{{human_avg_height}, {human_avg_weight}, {human_avg_lifespan},{function}})
And -
ifelse(${type}='human',{human_avg_height, human_avg_weight, human_avg_lifespan},{function}})
But none of it is working. What am i doing wrong ?
One way to do this would be to use three different calculated fields, one for all the heights, one for weights and one for lifespan. The heights one would look like this:
Make another calculated field for weights and lifespan and then add these calculated fields to your table, and filter by type.
To make it clear to the viewer what data is present, edit the Title of the visual to include the type:
${type} Data