# Custom SQL with dropdown parameter

**URL:** <https://community.amazonquick.com/t/custom-sql-with-dropdown-parameter/32544>\
**Category:** Q&A\
**Tags:** devops, developer, quick-sight\
**Created:** [July 12, 2024, 12:23pm UTC](https://community.amazonquick.com/t/custom-sql-with-dropdown-parameter/32544 "2024-07-12T12:23:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MOHAMMAD\_SAJEETH](https://avatars.discourse-cdn.com/v4/letter/m/82dd89/32.png) [@MOHAMMAD\_SAJEETH](https://community.amazonquick.com/u/MOHAMMAD_SAJEETH)\
**Post date:** [July 12, 2024, 12:23pm UTC](https://community.amazonquick.com/t/custom-sql-with-dropdown-parameter/32544/1 "2024-07-12T12:23:12Z")

</div>

I am currently working on a dataset in AWS Quick Sight and need to add a dropdown filter for the `state` field in my query. The SQL query I am using is as follows:

```auto
select * from all_flights
where origin_state_abr = <<$State>>

```

However, I am having trouble configuring this to allow for a dropdown menu that enables the selection of multiple values for the `state` field. I can only set a single value for `$State` at the moment.

Could you please provide guidance on how to create a dropdown filter in AWS Quick Sight that supports selecting multiple values for the `state` field?

---

<div class="post-metadata">

**Author:** ![Xclipse](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/xclipse/32/20455_2.png) [@Xclipse](https://community.amazonquick.com/u/Xclipse)\
**Post date:** [July 12, 2024, 12:39pm UTC](https://community.amazonquick.com/t/custom-sql-with-dropdown-parameter/32544/2 "2024-07-12T12:39:06Z")

</div>

Hi @MOHAMMAD_SAJEETH, welcome to the Quick Sight Community! Check out this resource:

_For example:_

```auto
select * from all_flights
where origin_state_abr in (<<$States>>)

```

> **[Advanced use cases of dataset parameters - Amazon QuickSight](https://docs.aws.amazon.com/quicksight/latest/user/dataset-parameters-advanced-options.html)**
>
> Learn how to create multivalue dropdown controls and dynamic controls in a QuickSight analysis using dataset parameters.

---

<div class="post-metadata">

**Author:** ![MOHAMMAD\_SAJEETH](https://avatars.discourse-cdn.com/v4/letter/m/82dd89/32.png) [@MOHAMMAD\_SAJEETH](https://community.amazonquick.com/u/MOHAMMAD_SAJEETH)\
**Post date:** [July 12, 2024, 1:29pm UTC](https://community.amazonquick.com/t/custom-sql-with-dropdown-parameter/32544/3 "2024-07-12T13:29:52Z")

</div>

1. In single value dropdown mode, only one value is shown at a time.
2. In multi-value dropdown mode, the filter allows multi-select, but the dropdown disappears when I unclick the parameter, and only reappears after resetting.

Could you please provide a detailed solution on how to create a dropdown filter in AWS Quick Sight that supports selecting multiple values for the `state` field? Including step-by-step instructions and screenshots would be greatly appreciated.
