# Ifelse() help

**URL:** <https://community.amazonquick.com/t/ifelse-help/17389>\
**Category:** Q&A\
**Tags:** calculations, quick-sight\
**Created:** [August 24, 2023, 9:55pm UTC](https://community.amazonquick.com/t/ifelse-help/17389 "2023-08-24T21:55:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chaitase](https://avatars.discourse-cdn.com/v4/letter/c/8e7dd6/32.png) [@Chaitase](https://community.amazonquick.com/u/Chaitase)\
**Post date:** [August 24, 2023, 9:55pm UTC](https://community.amazonquick.com/t/ifelse-help/17389/1 "2023-08-24T21:55:53Z")

</div>

Hi all, I have a column values like “UIE1-AW-HWL-10-2-AutoStop-User” , now I want to group, filter all values based on “AutoStop”.

I am trying the following in calculated field:

ifelse(  
contains({usage\_type}, ‘%AutoStop%’, CASE\_INSENSITIVE), {usage\_amount}, 0  
)

Somehow for the usage type that contains AutoStop, I get 0 rows returned.

Can you help what I need to do in order to return the rows that contains AutoStop as usage\_type?

---

<div class="post-metadata">

**Author:** ![Max](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/max/32/2288_2.png) [@Max](https://community.amazonquick.com/u/Max)\
**Post date:** [August 24, 2023, 10:06pm UTC](https://community.amazonquick.com/t/ifelse-help/17389/2 "2023-08-24T22:06:42Z")

</div>

Try and get rid of the %'s

```auto
ifelse(
contains({usage_type}, 'AutoStop', CASE_INSENSITIVE), {usage_amount}, 0
)

```

---

<div class="post-metadata">

**Author:** ![Chaitase](https://avatars.discourse-cdn.com/v4/letter/c/8e7dd6/32.png) [@Chaitase](https://community.amazonquick.com/u/Chaitase)\
**Post date:** [August 24, 2023, 10:28pm UTC](https://community.amazonquick.com/t/ifelse-help/17389/3 "2023-08-24T22:28:04Z")

</div>

Thanks Max! It worked.  
I have another similar question.  
I have product code column that has values like AWSCloudTrail, AmazonRedshift and a string like this eryhlhzpi9qp90nh5u371dw9z

I want to separate AWS/Amazon and categorize eryhlhzpi9qp90nh5u371dw9z as other.

Can you suggest a workaround?
