# Use Dynamic filter values in the calculated field

**URL:** <https://community.amazonquick.com/t/use-dynamic-filter-values-in-the-calculated-field/20873>\
**Category:** Q&A\
**Tags:** error, developer, qls-learningdash, quick-sight\
**Created:** [November 6, 2023, 8:56pm UTC](https://community.amazonquick.com/t/use-dynamic-filter-values-in-the-calculated-field/20873 "2023-11-06T20:56:51Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![misrsona](https://avatars.discourse-cdn.com/v4/letter/m/bcef8e/32.png) [@misrsona](https://community.amazonquick.com/u/misrsona)\
**Post date:** [November 6, 2023, 8:56pm UTC](https://community.amazonquick.com/t/use-dynamic-filter-values-in-the-calculated-field/20873/1 "2023-11-06T20:56:51Z")

</div>

My customer wants the ability to select the stations from the drop down list and based on that selection the qualification is displayed.  
Foe example- If User selected ‘A’, ‘B’, ‘C’ from the Qualification ‘XYZ’ Eligible Stations (drop down filter) then only for those stations XYZ Qualification column should show value else ‘NA’.  
Similary If User selected ‘A’, ‘B’, ‘C’ from the Qualification ‘123’ Eligible Stations (drop down filter) then only for those stations 123 Qualification column should show value else ‘NA’.

something like this : if station in (drop down filter values) then XYZ else ‘NA’

---

<div class="post-metadata">

**Author:** ![ErikG](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/erikg/32/14524_2.png) [@ErikG](https://community.amazonquick.com/u/ErikG)\
**Post date:** [November 6, 2023, 9:47pm UTC](https://community.amazonquick.com/t/use-dynamic-filter-values-in-the-calculated-field/20873/2 "2023-11-06T21:47:23Z")

</div>

Hi @misrsona  
Are you talking about

> **[Creating cascading filters - Amazon QuickSight](https://docs.aws.amazon.com/quicksight/latest/user/use-a-cascading-filter.html)**
>
> Use cascading filters for Amazon QuickSight visuals.

BR

---

<div class="post-metadata">

**Author:** ![misrsona](https://avatars.discourse-cdn.com/v4/letter/m/bcef8e/32.png) [@misrsona](https://community.amazonquick.com/u/misrsona)\
**Post date:** [November 6, 2023, 10:12pm UTC](https://community.amazonquick.com/t/use-dynamic-filter-values-in-the-calculated-field/20873/3 "2023-11-06T22:12:56Z")

</div>

Hi Erik, I want to show the data like below :  
employee id, , Station, XYZ Qualififcation, 123 Qualification  
e1 s1 yes yes  
e2 s2 NA yes  
e3 s3 Na NA  
based on the below condition:  
if station in (s1) then XYZ Qualififcation = ‘Yes’  
if station in (s1,s2) then 123 Qualififcation = ‘Yes’

However, instead of hardcoding static value in calculated filed, i want to pass the dynamic value in calculated. User will select which station is eligible for XYZ Qualififcation , in this case user will select ‘s1’ from the filter list.  
User will select which station is eligible for 123 Qualififcation , in this case user will select ‘s1,s2’ from the filter list.

---

<div class="post-metadata">

**Author:** ![misrsona](https://avatars.discourse-cdn.com/v4/letter/m/bcef8e/32.png) [@misrsona](https://community.amazonquick.com/u/misrsona)\
**Post date:** [November 6, 2023, 10:46pm UTC](https://community.amazonquick.com/t/use-dynamic-filter-values-in-the-calculated-field/20873/5 "2023-11-06T22:46:52Z")

</div>

I am trying this calculated field which works if I select few stations but does not work if i select all from the drop down filter :ifelse(in(building, ${ABCEligibleStations}) , {ABC\_qualified}, ‘NA’)

---

<div class="post-metadata">

**Author:** ![WLS-D](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/wls-d/32/36109_2.png) [@WLS-D](https://community.amazonquick.com/u/WLS-D)\
**Post date:** [December 1, 2023, 6:48pm UTC](https://community.amazonquick.com/t/use-dynamic-filter-values-in-the-calculated-field/20873/6 "2023-12-01T18:48:52Z")

</div>

Hello @misrsona !

From my understanding of the question I believe you need to add more logic to this function for it to work. For example:

```auto
ifelse(
${ABCEligibleStations} = 'A' OR
${ABCEligibleStations} = 'B' OR
${ABCEligibleStations} = 'C',
{ABC_qualified}, 
NULL
)

```

You may have to play with the AND/OR logic. The idea here is that you are telling quicksight that you want to see any row with a specific attribute like ${ABCEligibleStations} and if that is true, to show those rows where {ABC\_qualified} has values or is true.

Please let me know if this helps! If it did, please feel free to mark it as a solution to help the community.

---

<div class="post-metadata">

**Author:** ![WLS-D](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/wls-d/32/36109_2.png) [@WLS-D](https://community.amazonquick.com/u/WLS-D)\
**Post date:** [December 8, 2023, 4:40pm UTC](https://community.amazonquick.com/t/use-dynamic-filter-values-in-the-calculated-field/20873/7 "2023-12-08T16:40:22Z")

</div>

Hello @misrsona !

Were you able to try the suggestion I posted above, and if it worked could you mark the post as a solution to help the community?

---

<div class="post-metadata">

**Author:** ![misrsona](https://avatars.discourse-cdn.com/v4/letter/m/bcef8e/32.png) [@misrsona](https://community.amazonquick.com/u/misrsona)\
**Post date:** [December 8, 2023, 5:31pm UTC](https://community.amazonquick.com/t/use-dynamic-filter-values-in-the-calculated-field/20873/8 "2023-12-08T17:31:30Z")

</div>

Hi duncan@, my usecase was changed so did not have to apply this. Thanks for help!

---

<div class="post-metadata">

**Author:** ![WLS-D](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/wls-d/32/36109_2.png) [@WLS-D](https://community.amazonquick.com/u/WLS-D)\
**Post date:** [December 12, 2023, 3:28pm UTC](https://community.amazonquick.com/t/use-dynamic-filter-values-in-the-calculated-field/20873/9 "2023-12-12T15:28:12Z")

</div>


