Parameter value manipulation

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.
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.’

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’)


Thanks for your response!

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

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:

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 for sharing, this solution worked for me. Good point on flagging the issue for AWS Support

The contains unlike locate 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.