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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to split column in to two columns

Hi,

I have Address column like below

32 Beach Drive, Scratby, Great mouth, folk, UK, UY29 3NP

How can I get 32 Beach Drive, Scratby, Great mouth, folk, UK in one column and UY29 3NP in another column.

can anyone help me please.

Thanks.

37 Replies
Not applicable
Author

Hi Marcus, I suppose you are working on this . Any solution please.                       

marcus_malinow
Partner - Specialist III
Partner - Specialist III

Hi Amelia,

been a bit busy this afternoon so haven't looked at this any more.

I'm guessing that that particular record has one of the end fields missing so the wrong part of the address is getting into your town and country fields.

perhaps you could try a condition around the expressions for town, country and postcode,

for example

If(substringcount(Address, ',')>=5, subfield(Address, ',', -3)) as town,

If(substringcount(Address, ',')>=4, subfield(Address, ',', -2)) as country,

If(substringcount(Address, ',')>=3, subfield(Address, ',', -1)) as postcode,

Not applicable
Author

Hi, thanks for helping me in your busy time also. This time it is showing values blanks under Town and County where it contains data. Please find attached and help me.

marcus_malinow
Partner - Specialist III
Partner - Specialist III

Hi Amelia,

it would be useful to have the raw comma separated address strings for these records. Could you post them?

Marcus

Not applicable
Author

Hi Marcus,

could please find attached and help me to sort this completely as I have been this trying to sort since so many days.

I would appreciate if this could sorted complete.

Not applicable
Author

Hi Marcus,

I suppose you are working on this today. I would wait for your reply.

Thanks in advance.

marcus_malinow
Partner - Specialist III
Partner - Specialist III

Hi Amelia,

I haven't had much chance to look at this over the last day or so, but did a quick load to look at your data.

Unfortunately I think you're going to have problems here. Given the format / quality of your data I'm not sure you're going to be able to find a solution that copes with all circumstances.

I've loaded your data in, and with it used substringcount(Address, ',') to drive conditional processing for each field.

Taking, for example, the records where substringcount gives us a result of 5.

You have records where county is in position 4, and also records where town is in the same position.

Looking at the records with substringcount of 4, you have records with county in position 4, and also records where district is in the same position (e.g. Clifton).

Apologies for this not being a slightly more upbeat response, but I'm really not sure there's a complete solution here.

marcus


Not applicable
Author

Hi Marcus,

Thanks and no problem I understood as the data is in not in correct format order in my source that's how the problem came from. But up to now what you helped me is very much appreciated

thanks once again.