Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

How to create and append to a CSV via QlikView script

Hi All,

I wanted to know how would I (if possible) write to a CSV file in the QlikView Script and append to that file every reload thats done.

Example:

STORE "SomeDataTable" INTO "CSVDump.txt" (txt); //But the next time the reload happens the data in "SomeDataTable" must be appended to the CSV File

Thanks in advance,

Krisen

4 Replies
MVP
MVP

Re: How to create and append to a CSV via QlikView script

Hi Krisen,

There is no such statement as "APPEND" but you can do a two step load / store that will keep your old information besides the new records. Take a look at the following example:

SomeDataTable: // already existing records in your CSV file

LOAD *

FROM CSVDump.txt (options here);

NewRecords: // With same structure, field names and number of fields as in the table above

CONCATENATE (SomeDataTable) LOAD *

FROM NewData;

// Now the table "SomeDataTable" has both old and new rows

STORE "SomeDataTable" INTO "CSVDump.txt" (txt);

Hope that helps.

Miguel

jvitantonio
Valued Contributor III

How to create and append to a CSV via QlikView script

Hi, refer to help as "Incremental Reload"

Re: How to create and append to a CSV via QlikView script

Hi,

I suggest go  for incremental load for the data and then make the csv.

Regards,

Anand

Not applicable

Re: How to create and append to a CSV via QlikView script

Thanks guys for the guidance, i will have a look into the solutions.

The "source" data is actually a timestamp, one before loading and one after loading completes.

So in essence:

PSEUDO:

SET startTime = <timestamp>

STORE startTime to CSV

LOAD DATA

SET endTime = <timestamp>

Incremental Store endTime to CSV

Making sense?

Community Browser