Skip to main content

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Action-Packed Learning Awaits! QlikWorld 2023. April 17 - 20 in Las Vegas: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
michaelk
Creator
Creator

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?

michaelk
Creator
Creator
Author

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

michaelk
Creator
Creator
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
MVP & Luminary
MVP & Luminary

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?

michaelk
Creator
Creator
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
MVP & Luminary
MVP & Luminary

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

michaelk
Creator
Creator
Author

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