
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
IF left or right function
Hi.
What is the best way in the script to do some string functions like this,
if some places are with North or north (like london north or Dublin south) I would like to have the result "N" or "S".
Thanks in advance!
- « Previous Replies
-
- 1
- 2
- Next Replies »
Accepted Solutions


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You could try a mapping like:
map1:
Mapping load * Inline [
x, y
Norra, N
Södra, S
norra, N
södra, S
];
Then for your field do:
MapSubString('map1', Station) as Station
Hope this helps!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Capitalize(Left(Subfield(YourFieldName,' ',2),1))
Something like below...
=Capitalize(Left(Subfield('Dublin south',' ',2),1))

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Björn,
Wildmatch() could suit you
Fabrice

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I tried with:
if(wildmatch(station,'*North*'), 'N',
if(wildmatch(station,'*north*'),'N',
if(wildmatch(station,'*South*'),'S',
if(wildmatch(station,'*south*'),'S')))) as StationLink
But it doesen't give me the result I want. I have a field with many stations end I want to "wash" the field so that every station have a N or a S if they have two (or more) ways to exit the station.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Give us some example of your station field...
If my solution is not working?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
See attached example.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Maybe something like this?
pick(wildmatch(Station, '*Norra*', '*Södra*')+1, Station, 'N', 'S')
I wasn't sure what do to do if the name didn't have either north or south in it, so if it didn't it just returns the station name.
Hope this helps!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That one is not working. I'm looking for the station name and the N or S as London N.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Just to try and understand your requirements a little more, you want
'Bergshamra Norra' to be 'Bergshamra N'
and
'Bergshamra Södra' to be 'Bergshamra S'
?
What about if there is no South or North, you want just:
'Duvbo' to be 'Duvbo'
?
What if there is a North in the middle:
'Gardet Norra AU 1' to be 'Gardet AU 1 N'
?
Or do you want a field with just station and no directions, and then another field with either N, S, or null?
Can you describe it a little more?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes you have understand the requirement right. If the station have a direction it should be N or S.

- « Previous Replies
-
- 1
- 2
- Next Replies »