Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I would like to load the headers only into a temp table - where I can look for certain headers and then
decide what to load into where at a second stage of the import.
You can use
First 1
LOAD ....
LOAD *
FROM
[path_to_excel]
(txt, codepage is 1252, embedded labels, delimiter is ',', msq)
where 1=0;
First 1
Worked just fine - ok second step would be to access that line of data and the respective columns.:-)
Is that a question or is that something you plan to do
Sorry it was a question 🙂 and I plan to do it when I found out how 🙂
You can do a CrossTable Load to convert your list of columns into a single column with multiple rows:
Table1:
First 1
LOAD *
FROM Source;
Table2:
CrossTable(Columns, Data)
LOAD 1 as Flag,
*
Resident Table1;
DROP Table Table1;
Now Columns field will include all the column names that are available in your Excel file.
Ending up with Columns null again - as I did with FileName... lets try the question this way instead.
What I want to achieve is some way of dynamically pick column names based on what the excel file contains and save those into a field.
(in a batch of many excel-files that are similar but not exact)
example,
file 1 contains
State
file 2 contains
Stat
file 3 does not contain any of those
in my imported data i would like to have the result
State as State (from file 1)
Stat as State (from file 2)
"N/A" or just blank as State (from file 3)
Like I mentioned on your previous post, I am working on getting the previous method implemented in Qlik Sense. I will get back to you when I have something
Yep - that could also work (using the filename as variable for what is inside the file) - but its kind of a workaround for the scenario above 🙂 - anyway iam happy with anything that solves the enigma 🙂