Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

parse and split String in a tMap

hi,
I've got some excel file send by partners with some fields.
One of them send us the 'Adresse' in a single field , so I have to split it , analyse it to retrieve 'Code postal' and 'name of the town' ...etc !
I "have to" do this in a tMap : so read the input row => get the different value(throws a routine ?) => redirect each of them in respective output row .....
My problem its to redirect each value (@see the mapping screenshoot) => ADHCOP and ADHVIL at minimum !
I was thinking to use a routine with a String tabs return or hashMap and then redirect different value ...
or write them in static variables and read them later
but don't find how do that !
any suggestion will be appreciate
thanks
laurent
Labels (2)
4 Replies
Anonymous
Not applicable
Author

Hello,
I would use the "var table" in the middle to create intermediate variables and do the splitting using several regex.
If the extraction is really complex or you need to factorise this extraction elsewhere, create then use a routine.
I would do a routine for each field i need to extract.
Anonymous
Not applicable
Author

hi morbo and thanks for your reply
parse could be "complex" because some of name town will be split into several parts like french town "Plaisance du Touch" ....
I've also to analyse if the value before (normally postal code) IS a valide 'postal code' and so on ...
It's the reason why i was thinking about a routine ( and to re-use it 0683p000009MACn.png
But in that case i couldn't return array or hashMap for redirection in just a tMap as result
So a hashMap in my routine with getter function for each 'validate' value !?
Edit : i think you're right if I make a getter function foreach values I need , and put result in a var ....
negatice point is that i've to read and analyse several time same string value ...
Anonymous
Not applicable
Author

Hello,
Here is what u could do to avoid multiple reading :

Anonymous
Not applicable
Author

seems it's what i'm looking for .... 0683p000009MACn.png
gonna test it right now
thanks a lot Morbo
++
Edit : It's OK Morbo ... great !