# Parameter value manipulation

**URL:** <https://community.amazonquick.com/t/parameter-value-manipulation/17099>\
**Category:** Q&A\
**Tags:** parameters, calculations, feature-request, quick-sight\
**Created:** [August 16, 2023, 10:59pm UTC](https://community.amazonquick.com/t/parameter-value-manipulation/17099 "2023-08-16T22:59:01Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![aj2022](https://avatars.discourse-cdn.com/v4/letter/a/b4bc9f/32.png) [@aj2022](https://community.amazonquick.com/u/aj2022)\
**Post date:** [August 16, 2023, 10:59pm UTC](https://community.amazonquick.com/t/parameter-value-manipulation/17099/1 "2023-08-16T22:59:01Z")

</div>

I have a req to create a calculation using a parameter. I am using the correct syntax for functions, but getting the error ‘At least one of the arguments in this function does not have correct type. Correct the expression and choose Create again.’.  
Anyone have suggestions to make this work, please share.  
Calculation:  
ifelse(contains({Field1},concat(${Parameter1},‘.’)),‘True’,‘False’)  
Field1 and Parameter1, both are string type.

I am trying to compare if value entered by the user in Parameter1, followed by ‘.’ is present in Field1, then return True. For example - If user entered ‘Apple’ in Parameter1, then I want to check if Field1 contains ‘Apple.’

---

<div class="post-metadata">

**Author:** ![wstevens01](https://avatars.discourse-cdn.com/v4/letter/w/e9c0ed/32.png) [@wstevens01](https://community.amazonquick.com/u/wstevens01)\
**Post date:** [August 17, 2023, 12:43pm UTC](https://community.amazonquick.com/t/parameter-value-manipulation/17099/2 "2023-08-17T12:43:16Z")

</div>

Hi @aj2022 ,

It looks like the contain() function doesn’t like the concat function. Even you concat two hard-coded values, it still gives an error. I’ll keep noodling on this, but the only work-around that I can suggest right now is to require the parameter to include the dot.

So this calculation works if you add the dot to the parameter - ifelse(contains(address, ${Parameter1}),‘True’,‘False’)

 ![Screen Shot 2023-08-17 at 6.41.57 AM](https://d1wl4jav5dp96l.cloudfront.net/original/2X/5/5d2230de4bb855a1f469ef90d5dfb036ff35ef87.png)

ws

---

<div class="post-metadata">

**Author:** ![aj2022](https://avatars.discourse-cdn.com/v4/letter/a/b4bc9f/32.png) [@aj2022](https://community.amazonquick.com/u/aj2022)\
**Post date:** [August 17, 2023, 7:03pm UTC](https://community.amazonquick.com/t/parameter-value-manipulation/17099/3 "2023-08-17T19:03:54Z")

</div>

Thanks for your response!

Unfortunately, in this case I cant educate the users to add the ‘.’ instead.

---

<div class="post-metadata">

**Author:** ![wstevens01](https://avatars.discourse-cdn.com/v4/letter/w/e9c0ed/32.png) [@wstevens01](https://community.amazonquick.com/u/wstevens01)\
**Post date:** [August 17, 2023, 7:45pm UTC](https://community.amazonquick.com/t/parameter-value-manipulation/17099/4 "2023-08-17T19:45:04Z")

</div>

Hi @aj2022 ,

This might be a good work-around:

ifelse(locate(address, concat(${Parameter1}, ‘.’), 0) \> 0,‘True’,‘False’)

I get this result using this calculated field:

 ![Screen Shot 2023-08-17 at 1.42.56 PM](https://d1wl4jav5dp96l.cloudfront.net/original/2X/f/f7605aacc0bf690c90e3f227ff5bb8323d1ece1a.png)

If this works for you, would you mind opening a ticket with AWS support and let them know that concat fails when it’s part of the contain() function, but doesn’t fail when it’s part of the locate() function.

Thanks!

ws

---

<div class="post-metadata">

**Author:** ![aj2022](https://avatars.discourse-cdn.com/v4/letter/a/b4bc9f/32.png) [@aj2022](https://community.amazonquick.com/u/aj2022)\
**Post date:** [August 22, 2023, 9:33pm UTC](https://community.amazonquick.com/t/parameter-value-manipulation/17099/5 "2023-08-22T21:33:14Z")

</div>

Thanks for sharing, this solution worked for me. Good point on flagging the issue for AWS Support

---

<div class="post-metadata">

**Author:** ![robdhondt](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/robdhondt/32/194_2.png) [@robdhondt](https://community.amazonquick.com/u/robdhondt)\
**Post date:** [August 23, 2023, 12:03am UTC](https://community.amazonquick.com/t/parameter-value-manipulation/17099/6 "2023-08-23T00:03:53Z")

</div>

The [contains](https://docs.aws.amazon.com/quicksight/latest/user/contains-function.html) unlike [locate](https://docs.aws.amazon.com/quicksight/latest/user/locate-function.html) only accepts a string literal such as `'string literal'` as the substring argument, it does not allow column or function references.

I’ve flagged this as a feature request and an opprounity to improve the public doc.
