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!
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
Thanks Marcus,
Seems as the work around ideas supports only qlikview,
Any idea for qlik sense?
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
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!
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)],
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
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
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
Yes Marcus their are records in the table.
in some records, some fields are missing.
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