Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a problem in loading an Excel file as QV doesnt parse the headers. I guess it is because of the line breaks in the headers like this one:
Project
Id
QV reads it as:
Directory;
LOAD [Project
Id],
and gives error.
Manuel correction in the Excel file is not one of the solutions in my case.
Thanks.
s
orry for the not readable text above. it is just here:
let
c=('Project' & chr(10) & 'Id');
LOAD
[$(c)] asProjectId
FROM
.....
Hi,
maybe you can use:
LOAD @1 as [Project Id], ...
- Ralf
Hi Necmeltin
can you attach the file for i have a look at it?
regards
christian
No doubt it will work. A better solution may handle the changes in the order of the headers.
@1 was wrong..
You could load the header line first and analyze the record for changes. Then, maybe use variables to set the field names. After that, load verything from second row:
LET vField1='Project_Id';
LOAD A as $(vField1)
FROM
C:\buffer\header.xlsx
(ooxml, no labels, header is 1 lines, table is Tabelle1);
- Ralf
I really wonder why QV doesnt handle any Excel field header that has a new line break in it.
Maybe it's just a bug in script interpretation... I've tried some workarounds but with no success.
- Ralf
I have found a solution like below:
let
LOAD
[$(c)] as ProjectIdFROM ...
c=('Project' & chr(10) & 'Id');s
orry for the not readable text above. it is just here:
let
c=('Project' & chr(10) & 'Id');
LOAD
[$(c)] asProjectId
FROM
.....
Not sure why this thread from 2011 is popping up in the recent queue, but..
to add comments, white-space including line breaks do work in Excel field names (but it is a horrid way to name fields). Just be sure to match the amount of white space in the QlikView script programmatically to the amount embedded in the Excel spreadsheet. It is a good idea to encapsulate the white-space with square braces so you know where it stops/starts. Again though.. the worst field names ever.