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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
lionel_t
Contributor
Contributor

text transformation

Hello,

    I have a modeling question. I want to turn my data from this format:

country

town
country1a;b;c;d
country2e;f;g

to this one:

country

town
country1a
country1b
country1c
country1d
country2e
country2f
country2

g

thanks for your help

6 Replies
its_anandrjs
Champion III
Champion III

Hi,

Yes load your table with subfield function

A:

Load country,    SubField(town,';') as Town;

LOAD * Inline

[

country,    town

country1,    a;b;c;d

country2,    e;f;g

];

sub.png

Regards

Anand

alexandros17
Partner - Champion III
Partner - Champion III

load country, subfield(town';') resident mytable;

where mytable is your source table

datanibbler
Champion
Champion

Hi Lionel,

if the separator is always the same (between the letters  in the column >town<), then you can use the SUBFIELD() function .- you must parse the table record by record and use SUBFIELD() on each one in turn - that will turn each one into as many records as there are letters.

HTH

Best regards,

DataNibbler

lionel_t
Contributor
Contributor
Author

Hello,

     it works thank you all.

Lionel TEA

Anonymous
Not applicable

Hi

Could you please mark question as answered.

Thank you.

its_anandrjs
Champion III
Champion III

Hi Lionel,

Close the thread by appropriate answers.

Regards

Anand