Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
GENClik60
Contributor III
Contributor III

QlikView Script

*english below*

Hallo zusammen,
ich hab mal eine Frage und zwar habe ich verschiedene CSV-Dateien die ich in einem View zusammmenführen möchte.
Es sind zwei Ordner mit CSV mit zwei Häusern. Die CSV-Dateien der Häuser sind gleich aufgebaut (Daten aus Haus 1 und Haus 2).

Wie kann ich diese CSV-Dateien am besten im Skript laden ohne Sync-Keys zu erzeugen?
Wie kann ich zu einer bestehenden CSV-Datei im Skript noch eine Dimension ergänzen?
(Als Beispiel: wenn die Hausbezeichnung in der CSV-Datei nicht vorhanden ist, diese aber zu ergänzen ist; alle Daten aus Haus 1 soll als Dimension ergänzt werden mit dem Wert: "Haus1")

Danke schon mal für die Rückmeldung.

Gruß GENClik60

*English*

Hello, everyone,
I have a question and I have different CSV files that I want to merge into one view.
It's two folders with CSV with two houses. The CSV files of the houses have the same structure (data from house 1 and house 2).
How can I best load these CSV files in the script without generating sync keys?
How can I add a dimension to an existing CSV file in the script?
(As an example: if the house name is not available in the CSV file, but it needs to be added; all data from house 1 should be added as a dimension with the value: "House1")
Thanks in advance for the feedback.

Labels (1)
1 Solution

Accepted Solutions
marcus_sommer

It's quite simple - just concatenating the data, like:

t: load *, filebasename() as Haus from path\csv1.csv (txt);
concatenate(t) load *, filebasename() as Haus from path\csv2.csv (txt);

Instead of filebasename() you may also add the needed information manually.

- Marcus

View solution in original post

3 Replies
marcus_sommer

It's quite simple - just concatenating the data, like:

t: load *, filebasename() as Haus from path\csv1.csv (txt);
concatenate(t) load *, filebasename() as Haus from path\csv2.csv (txt);

Instead of filebasename() you may also add the needed information manually.

- Marcus

GENClik60
Contributor III
Contributor III
Author

Hello Marcus,

Thanks for the reply, I managed to merge the tables now.
Can I manually add something to a table in the script?
There is no record with the "Status" field in the source file, I would add this manually.
As an example, if the source file is loaded from table 1, a field should be added with the field "Status=1".

Thanks in advance 🙂
- GENClik60

marcus_sommer

You could do it in this way:

t: load *, filebasename() as Haus, 1 as Status from path\csv1.csv (txt);
concatenate(t) load *, filebasename() as Haus, 0 as Status from path\csv2.csv (txt);

- Marcus