# Not able to add additional filtering method (case when) to dataset

**URL:** <https://community.amazonquick.com/t/not-able-to-add-additional-filtering-method-case-when-to-dataset/17755>\
**Category:** Q&A\
**Tags:** SQL, error, Business-Intelligence-Engineer, dataset, quick-sight\
**Created:** [September 6, 2023, 9:12pm UTC](https://community.amazonquick.com/t/not-able-to-add-additional-filtering-method-case-when-to-dataset/17755 "2023-09-06T21:12:28Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![seanc](https://avatars.discourse-cdn.com/v4/letter/s/ad7895/32.png) [@seanc](https://community.amazonquick.com/u/seanc)\
**Post date:** [September 6, 2023, 9:12pm UTC](https://community.amazonquick.com/t/not-able-to-add-additional-filtering-method-case-when-to-dataset/17755/1 "2023-09-06T21:12:29Z")

</div>

In this Aug EDW ASIN Selection datasets (which was created through custom SQL), we want to add a new column to be added - [https://us-east-1.quicksight.aws.amazon.com/sn/data-sets/2a339b76-69d5-4c91-9c51-4d7cb99f1eca/view](https://us-east-1.quicksight.aws.amazon.com/sn/data-sets/2a339b76-69d5-4c91-9c51-4d7cb99f1eca/view) - “Case when asin in (select distinct asin from f3rbi.vw\_mdl\_instock\_exclusion\_asins) then ‘ExcludeUwiForCircularCheck’ else ‘IncludeUWIForCircularCheck’ end as UWIFlag” but the dataset doesn’t refresh/update properly.

I have tried in hubble and the query worked, however not in Quicksight. Our temporary solve is hardcoding the asins that we want to inlcude in the dataset, but this is not scalable as new ASINs will be added in to the table, and we want this reference to be dynamic.

---

<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:** [September 7, 2023, 8:59pm UTC](https://community.amazonquick.com/t/not-able-to-add-additional-filtering-method-case-when-to-dataset/17755/2 "2023-09-07T20:59:59Z")

</div>

Hello @seanc!

The community will not be ably to access you Quicksight via that link.

When you say that the dataset doesn’t refresh or update properly, does Quicksight provide an error message or any kind or are there problems with the resulting dataset?

---

<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:** [September 11, 2023, 2:27pm UTC](https://community.amazonquick.com/t/not-able-to-add-additional-filtering-method-case-when-to-dataset/17755/3 "2023-09-11T14:27:27Z")

</div>

Hello @seanc !

Are you still running into this issue and are you able to provide the error message that you received?

---

<div class="post-metadata">

**Author:** ![seanc](https://avatars.discourse-cdn.com/v4/letter/s/ad7895/32.png) [@seanc](https://community.amazonquick.com/u/seanc)\
**Post date:** [September 11, 2023, 5:25pm UTC](https://community.amazonquick.com/t/not-able-to-add-additional-filtering-method-case-when-to-dataset/17755/4 "2023-09-11T17:25:14Z")

</div>

![Query not updating](https://d1wl4jav5dp96l.cloudfront.net/original/2X/0/0441f66736b83453ecc6417911acd1762e64a542.jpeg)

This is the error I have

---

<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:** [September 12, 2023, 3:15pm UTC](https://community.amazonquick.com/t/not-able-to-add-additional-filtering-method-case-when-to-dataset/17755/5 "2023-09-12T15:15:12Z")

</div>

Hello @seanc !

Thank you for posting the error message!

I believe that error is originating from Redshift. My main thought here is that it’s possibly something to do with an issue with data types of the key values during the joins.

Also, when you are trying to import this are you doing it via Spice or Direct query?

---

<div class="post-metadata">

**Author:** ![seanc](https://avatars.discourse-cdn.com/v4/letter/s/ad7895/32.png) [@seanc](https://community.amazonquick.com/u/seanc)\
**Post date:** [September 18, 2023, 10:31pm UTC](https://community.amazonquick.com/t/not-able-to-add-additional-filtering-method-case-when-to-dataset/17755/6 "2023-09-18T22:31:45Z")

</div>

via SPICE. Is there any time i can set up with you to go over what we are trying and the issue we are running into?

---

<div class="post-metadata">

**Author:** ![gillepa](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/gillepa/32/3891_2.png) [@gillepa](https://community.amazonquick.com/u/gillepa)\
**Post date:** [September 21, 2023, 4:52pm UTC](https://community.amazonquick.com/t/not-able-to-add-additional-filtering-method-case-when-to-dataset/17755/7 "2023-09-21T16:52:47Z")

</div>

@seanc  
can you post the query here?  
Where is the data coming from, what type of database?  
GL

---

<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:** [October 3, 2023, 2:52pm UTC](https://community.amazonquick.com/t/not-able-to-add-additional-filtering-method-case-when-to-dataset/17755/8 "2023-10-03T14:52:41Z")

</div>

Hello @seanc , sorry for the late reply I was OOO!

Are you able to post the query like @gillepa suggested?

---

<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:** [October 6, 2023, 2:45pm UTC](https://community.amazonquick.com/t/not-able-to-add-additional-filtering-method-case-when-to-dataset/17755/9 "2023-10-06T14:45:17Z")

</div>

Hello @seanc ! Are you able to share the query?

It’s been a few days since we have heard from you but we would still like to help find a solution. If we do not hear from you in 3 days this topic will be archived.

---

<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:** [October 9, 2023, 3:51pm UTC](https://community.amazonquick.com/t/not-able-to-add-additional-filtering-method-case-when-to-dataset/17755/10 "2023-10-09T15:51:09Z")

</div>

Archived on October 9, 2023, 3:51pm UTC


