Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello
how to save csv files and do not write the header "no labels" (the first line should contain the values, not the header)?
On utilisant Store je dois sauvegarder des fichiers CSV mais ces fichiers ne doivent pas contenir l'étiquette ou l'entête.
Malgré que j'utilise no labels ca marche pas.
comment sauvegarder des fichiers csv et ne pas écrire l’entête ( la première ligne doit contenir les valeurs et non pas l'entête)?
Voici le scénario Que j'utilise:
STORE KEY as [],
MOIS as [] from TEST INTO TEST.csv (txt, delimiter is ';' , no labels);
;
Merci d'avance
Hi there,
Stefan Stoichev has a posting about this, basically you need to replace the column headers with first row values.
https://sstoichev.eu/2015/05/02/save-qlikview-table-as-csv-without-header/
Another method
Export chart to delimited file using any delimiter and removing headers
Alternatively, you could use a powershell script or other post-processing to slice out the first row of a text file.
cheers,
Andrew
That's not possible. The STORE command can only output tables including the field names. It cannot output files that contain only the data and not the field names.
an idea
source:
load * inline [
field1, field2
a,1
b,2
c,3
d,4
];
tmp: NoConcatenate load * Resident source Where recno()=1;
let f1=Peek('field1', 0, 'tmp');
let f2=Peek('field2', 0, 'tmp');
final: NoConcatenate load field1 as '$(f1)', field2 as '$(f2)' Resident source where recno()>1;
store final into final.txt (txt, delimiter is ';');
Thank you Massimo and Andrew
merci bcp
Great idea, but does not work in the case where values on the first row are identical:
source:
load * inline [
field1, field2, field3
a,1,1
b,2,2
c,3,10
d,4,4
e,4,5
f,2,6
];
tmp: NoConcatenate load * Resident source Where recno()=1;
let f1=Peek('field1', 0, 'tmp');
let f2=Peek('field2', 0, 'tmp');
let f3=Peek('field3', 0, 'tmp');
final: NoConcatenate load
field1 as '$(f1)',
field2 as '$(f2)',
field3 as '$(f3)'
Resident source where recno()>1;
store final into final.txt (txt, delimiter is ',');
I am thinking about multiple joins (I have 9 fields to be saved into CSV) and I do not see another option...
Any other suggestions?
Regards,
Vlad
Found the solution:
Change the numeric format:
field1, field2, field3
a,1,1.0
VK