Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Can I load only first row in an Excel sheet?

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.

1 Solution

Accepted Solutions
sunny_talwar

You can use

First 1

LOAD ....

View solution in original post

9 Replies
sunny_talwar

You can use

First 1

LOAD ....

ali_hijazi
Partner - Master II
Partner - Master II

LOAD *

FROM

[path_to_excel]

(txt, codepage is 1252, embedded labels, delimiter is ',', msq)

where 1=0;

I can walk on water when it freezes
Not applicable
Author

First 1

Worked just fine - ok second step would be to access that line of data and the respective columns.:-)

sunny_talwar

Is that a question or is that something you plan to do

Not applicable
Author

Sorry it was a question 🙂 and I plan to do it when I found out how 🙂

sunny_talwar

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.

Not applicable
Author

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)

sunny_talwar

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

Not applicable
Author

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 🙂