Quicksight: hide filter based on another filter selection

Hello, in AWS Quicksight i have 2 control filters.
Filter 1:

  • filter by Name -
    Filter by Email

Based on Filter1 selection i want to show “Filter 2 - Name” OR “Filter 3- Email”.
How to do this?

You can do this using parameters. I’m assuming you already have 2 fields called Name and Email.

  1. Create a parameter, e.g. call it NameEmail. Give it a static default value, e.g. Filter by Name.

  2. Add the parameter as a control with the following values: Filter by Name, Filter by Email. This is your filter 1.

  3. Create a calculated field that uses your parameter.

    Name or Email = ifelse(${NameEmail} = ‘Filter by Name’, {Name}, ${NameEmail} = ‘Filter by Email’, {Email}, null)

    This is basically saying if the user selects ‘Filter by Name’ in your first control (created from the parameter), the Name or Email field should be the same as your Name field. If the user selects ‘Filter by Email’, the Name or Email field should be the same as your Email field.

  4. Create a filter on the Name or Email calculated field and add it as your control. This is your filter 2/3.

Expression ifelse(${NameEmail} = ‘Filter by Name’, {Name}, {Email}) for function = has incorrect argument type String List = String. Function syntax expects ‘<COMPARABLE_TYPE> = <COMPARABLE_TYPE>’.

Aren’t Name and Email both text fields?

${NameEmail} is a List

NameEmail is the parameter created in step 1. Did you create it like this?

After you create it, use it to add a control like this:

1 Like

I think I found the issue. The single quotes that I put in my calculation here don’t copy and paste properly in QuickSight.

Manually type them in QuickSight. If the text is recognized correctly as a string, you’ll see it in green.

1 Like

Hi @silpa Did @David_Wong’s solution work for you? I am marking this reply as, “Solution,” but let us know if this is not resolved. Thanks for posting your questions on the QuickSight Community Q&A Forum!

1 Like