Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Parse string with fields in quotes

Hi,

I have data of the form:

"Date1","Name1, Surname1","Item1","Otheritem1"

"Date2","Name2, Surname2","Item2","Otheritem2"

How do I get the data fields separated? I've tried 'subfield', but this caused Problems with the comma in the Name field. I know there is a 'textbetween' function, but I couldn't figure out how to use it to parse for all the fields in a row.

Thanks

Michael

9 Replies
jayshrinipurte
Partner - Creator
Partner - Creator

Can you post expected output?

Anonymous
Not applicable
Author

And the data is not available as a Excel-file or a csv-file. It is generated temporarily within a script!

Anonymous
Not applicable
Author

Hi,

the Output should be like:

Dataset             Data

1                        Date1

1                        Name1, Surname1

1                        Item1

1                        Otheritem1

2                        Date2

2                        Name2, Surname2

2                        Item2

2                        Otheritem2

marcus_sommer

I think I would just use the comma as delimiter and concat the name and surname afterwards again.

- Marcus

Ralf_Heukäufer
Partner - Creator III
Partner - Creator III

Hallo Michael,

was genau meinst du mit Problemen mit dem Komma im Namensfeld?

Sollen Name und Nachname nicht getrennt werden oder treten andere Probleme auf?

Anonymous
Not applicable
Author

Hallo Ralf,

ja genau, die beiden Namensfelder sollen nicht getrennt werden!

Ralf_Heukäufer
Partner - Creator III
Partner - Creator III

Helptable:

Load

subfield(Textfeld,',1') as Date,

subfield(Textfeld,',2') as Name,

subfield(Textfeld,',3') as Nachname,

subfield(Textfeld,',4') as Item,

subfield(Textfeld,',5') as OtherItem

from....;

Haupttabelle:

Load

Date,

Name &' '& Nachname as Name,

Item,

OtherItem

resident Helptable;

Drop Table Helptable;

marcus_sommer

Beside the approach of splitting the data by the comma and concat the needed results you could also adjust this part:

..."It is generated temporarily within a script"...

Another way might be to store these data into a csv and reading them again with the msq option in the file-format.

- Marcus

Anonymous
Not applicable
Author

I found a simple solution. just used SUBFIELD(Row,'",') to separate the fields.