Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
roisolberg
Creator
Creator

Qlik Sense - Storing into a CSV file without the header data

Hi All,

I am exporting a report into a CSV file using Qlik Sense and i am trying to remove the column headers from the file and keep only the data stored.

my store command : Store DailyReport into "lib://CSV/SHP[$(Company)]_$(vDateS)_$(vTimeS)_F.csv"(txt, delimiter is '|');

i've tried searching in past discussions but i could'nt find a matching solution.

If anyone has any experience on the matter i'd much appreciate,

Thanks in advance!

13 Replies
marcus_sommer

If Qlik would had had extended the filefomat-statement within store-command in Sense like it worked by loading a text-file you could use there "no labels" - but I doubt it.

This meant you will need a workaround for your task, for example: Re: Store do not write the header "no labels".

- Marcus

roisolberg
Creator
Creator
Author

Thanks Marcus,

Seems as the work around ideas supports only qlikview,

Any idea for qlik sense?

marcus_sommer

This is just a script-solution and will work for both View and Sense: https://sstoichev.eu/2015/05/02/save-qlikview-table-as-csv-without-header/

- Marcus

roisolberg
Creator
Creator
Author

Thanks Marcus,

Actually i've just managed to generate the CSV without the header, but the load statement is failing.

i have used the following script:

SerialOutDailyReportSOURCE:

LOAD

    Serial,

    Box_ID,

    SO,

    PickUpDate,

    DeliveryNumber_SAP

  

FROM [lib://Schema (win-_administrator)/SerialOutDailyReport_Temp1.qvd]

(qvd)

WHERE LEN(Serial)>0;


Temp: NoConcatenate load * Resident SerialOutDailyReportSOURCE Where recno()=1;


let f1=Peek('Serial', 0, 'Temp');

let f2=Peek('Box_ID', 0, 'Temp');

let f3=Peek('SO', 0, 'Temp');

let f4=Peek('PickUpDate', 0, 'Temp');

let f5=Peek('DeliveryNumber_SAP', 0, 'Temp');


SerialOutDailyReport_Final:

NoConcatenate load

Serial as '$(f1)',

Box_ID as '$(f2)',

SO as '$(f3)',

PickUpDate as '$(f4)',

DeliveryNumber_SAP as '$(f5)'

Resident SerialOutDailyReportSOURCE where recno()>1;


Store SerialOutDailyReport_Final into "lib://CSV/SHP[$(vSLP)]_$(vDateS)_$(vTimeS)_F.csv"(txt, delimiter is '|');

and I am getting the following error:


Blank field name not allowed: SerialOutDailyReport_Final: NoConcatenate load Serial as '', Box_ID as '', SO as '', PickUpDate as '', DeliveryNumber_SAP as '' Resident SerialOutDailyReportSOURCE where recno()>1


Any Ideas?

Thanks!

marcus_sommer

Try it in this way:

SerialOutDailyReportSOURCE:

LOAD

    Serial,

    Box_ID,

    SO,

    PickUpDate,

    DeliveryNumber_SAP

  

FROM [lib://Schema (win-_administrator)/SerialOutDailyReport_Temp1.qvd]

(qvd)

WHERE LEN(Serial)>0;


let f1=Peek('Serial', 0, 'SerialOutDailyReportSOURCE');

let f2=Peek('Box_ID', 0, 'SerialOutDailyReportSOURCE');

let f3=Peek('SO', 0, 'SerialOutDailyReportSOURCE');

let f4=Peek('PickUpDate', 0, 'SerialOutDailyReportSOURCE');

let f5=Peek('DeliveryNumber_SAP', 0, 'SerialOutDailyReportSOURCE');


SerialOutDailyReport_Final:

NoConcatenate load

Serial as [$(f1)],

Box_ID as [$(f2)],

SO as [$(f3)],

PickUpDate as [$(f4)],

DeliveryNumber_SAP as [$(f5)]

Resident SerialOutDailyReportSOURCE where recno()>1;


Store SerialOutDailyReport_Final into "lib://CSV/SHP[$(vSLP)]_$(vDateS)_$(vTimeS)_F.csv"(txt, delimiter is '|');

- Marcus

roisolberg
Creator
Creator
Author

It is the same error 😕

Blank field name not allowed: SerialOutDailyReport_Final: NoConcatenate load Serial as [], Box_ID as [], SO as [], PickUpDate as [], DeliveryNumber_SAP as [] Resident SerialOutDailyReportSOURCE where recno()>1

marcus_sommer

Are there any records within this table?

SerialOutDailyReportSOURCE:

LOAD

    Serial,

    Box_ID,

    SO,

    PickUpDate,

    DeliveryNumber_SAP

FROM [lib://Schema (win-_administrator)/SerialOutDailyReport_Temp1.qvd]

(qvd)

WHERE LEN(Serial)>0;


just comment out the following stuff and look if the load worked like expected.


- Marcus

roisolberg
Creator
Creator
Author

Yes Marcus their are records in the table.

in some records, some fields are missing.

marcus_sommer

Are there any NULL's within the first record?

Further if there is any qualifying within your script - disable it and check the approach again.

- Marcus