Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am trying to group my fieldname 'Location' into 4 categories using WildMatch function, but it's not working, what am I doing wrong?
If(WildMatch(Location,'*London*','London',
if(WildMatch(Location,'*Birmingham*'),'Birmingham',
if(WildMatch(Location,'*Edinburgh*'),'Edinburgh',
If(WildMatch(Location,'*US*'),'US')))),Location) as Location
The fieldname 'Location' has the following values:
Bleak Street, London
Liverpool Street, London
Praed Street, Birmingham
Commercial Street, Birmingham
Royal Street, Edinburgh
Princes Street, Edinburgh
US Location
And I want to take the key words 'London', 'Birmingham', Edinburgh', and 'US', to group locations into 4 categories in my 'Location' fieldname.
May be this:
If(WildMatch(Location,'*London*'), 'London',
If(WildMatch(Location,'*Birmingham*'), 'Birmingham',
If(WildMatch(Location,'*Edinburgh*'), 'Edinburgh',
If(WildMatch(Location,'*US*'),'US', Location)))) as Location
May be this:
If(WildMatch(Location,'*London*'), 'London',
If(WildMatch(Location,'*Birmingham*'), 'Birmingham',
If(WildMatch(Location,'*Edinburgh*'), 'Edinburgh',
If(WildMatch(Location,'*US*'),'US', Location)))) as Location
If(wildmatch(Location, 'US *', 'US', subfield(Location, ',',-1)) as Location
another way
If(Location like '*London*', 'London',
If(Location like '*Birmingham*', 'Birmingham',
If(Location like '*Edinburgh*', 'Edinburgh',
If(Location like '*US*' ,'US', Location)))) as Location
You left a parenthesis after Edinburgh
Updated. It's very difficult to modify copy pasted expression
Agreed
I do that all the time