Search code examples
amazon-quicksight

AWS Quicksight: Comparing one string column against another


Trying to build a calculated field in Quicksight so i can compare one string column against another and return a Boolean/integer if it matches, basically the equivalent of this in Power BI:

IF (
CONTAINSSTRING ( 'Owners Reg'[Registered Owner],'Owners Reg'[Alias_AKA.1] )
|| CONTAINSSTRING ( 'Owners Reg'[Alias_AKA.1], 'Owners Reg'[Registered Owner])
,
"Yes",
"No"
)

I've found the locate function but I'm struggling to see how i can use it. I was thinking something along the lines of

locate({Registered Owner},{Alias_AKA.1})

but i can't find any example of locate being used in the way i want to. Can anyone please help point me in the right direction as i'm a new user to AWS QS coming from Power BI


Solution

  • You are almost there, just need to add another function - ifelse

    Following can be used -

    ifelse(locate({String-1},{String-2}) > 0,'yes','no')
    

    Refer sample data-set and function result below -

    enter image description here