Discussion Board for collaboration on QlikView Scripting.
I used wizard to load a simple csv file. The catch is a blank field name. QV generated the following script which fails..
(txt, codepage is 1252, embedded labels, delimiter is ';', msq);
The CSV content is just like this ( there is no name for the first field)
I could load it like this, but I would need to rename the @X to the real field name and my real CSV has too many fields...
(txt, codepage is 1252, no labels, delimiter is ';', msq, header is 1 lines);
So, how can I easily recognize this field renaming just this one?
if it is a true CSV i.e. comma delimeted the delimeter is wrong : -
(txt, codepage is 1252, embedded labels, delimiter is ',', msq);
I would load the fields line first in QV like this :
First 1 LOAD @1 FROM
(txt, codepage is 1252, no labels, delimiter is ',', msq);
Then I would loop through it trying to identify where the field name is missing, and form a new field list string to use in the normal load.
The load above works but the rest is only theory, have not tried it...
You're right, it wasn't a CSV, but I correct the file and the script and the problem persist.
It fails even if it is a Load *
It would be possible to use your first load and use it to generate field names in the following script:
I'd put @1 from your script in a variable and use subfield to segment it...
Then I could apply the names on the fields from the second part...
It's seem very complicated but it would work
Hope there is still an easier solution
try changing codepage is 1252 to UTF8
Sorry, same errror...
I tried to recognized the field name and solve it using this:
LOAD  as x,
Then, In a stranger source file, I tried to read two blank field names and this code also worked:
 as y,
Maybe the wizard should help us create this...