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