Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
manojkulkarni
Valued Contributor II

Read range of columns in Excel

Hi Friends,

Is there a way to read only few columns or set of columns from given excel. I have excel having 50+ columns but need to read only first 25 columns. How can we achieve this ?

14 Replies

Re: Read range of columns in Excel

You can do this if you have 25 field names in another excel file with same name as in actual excel

manojkulkarni
Valued Contributor II

Re: Read range of columns in Excel

Yes , all excels will have 25 columns. In some of we are more excels which we don't want to read

manojkulkarni
Valued Contributor II

Re: Read range of columns in Excel

Column names are not fixed

Re: Read range of columns in Excel

Do you already have any For each / Loop script ??

Life is so rich, and we need to respect to the life !!!
prieper
Honored Contributor II

Re: Read range of columns in Excel

Load without header from Excel, e.g.

LOAD A,B,C,D,E..... FROM...

Then read only the first line, which may contain the headers,

and do a renaming of the fields

HTH Peter

vinieme12
Esteemed Contributor II

Re: Read range of columns in Excel

What exactly is your requirement?

Load only First 25 columns?

or

Load only 25 columns ?

if Column names are not fixed then how do you identify which columns to load?

manojkulkarni
Valued Contributor II

Re: Read range of columns in Excel

Column names are days of the Month (in DD-mm-yyyy format). This differs for every month.

We are not getting exactly 30/31 days columns. Some time it comes with 50 or more columns which is not required for us.

prieper
Honored Contributor II

Re: Read range of columns in Excel

but then it may make sense to load with CROSSTABLE in first instance,

then inspect the fieldcontents and drop all fields, not being a valid date....

afsarshaikh
New Contributor III

Re: Read range of columns in Excel

Place condition WHERE RecNo() >= 1 AND RecNo() < 26  at the end of your LOAD script (before the semicolon).


Hope this works!

Regards,
Project Manager- QlikView Dev. & Support
Afsar Shaikh
Email- afsar.shaikh@live.com
Community Browser