Download Set Analysis Primer

x

How to Extract Excel Sheet Name

If you are a Qlik developer, you know how to load data from Excel as it is a fairly straight forward process.

But, what if you need to extract each sheet name as you load the respective table from Excel?

Let’s explore the steps first.

  1. Load all tables first (All sheets within an Excel file)
  2. Loop through tables to extract sheet name
  3. Loop through all the sheets from step 2 and add sheet name to the respective table.

// 1. Load all tables first (All sheets within an Excel file)

// 2. Loop through tables to extract sheet name

/3. * Loop through all the sheets from step 2 and add sheet name to the respective table. */

Do you want to get Qlik certified and improve your skills and earnings?

Join our academy and let us help you with that!

(Photo credit: Unsplash)

If you enjoyed this article, get email updates (it’s free).

* indicates required
About the author

4 Responses
    1. Analytics Hub

      Hi Rob, great to see your comment. The script works without a hard-coding table name. Someone asked how to extract table names without any intervention so I thought of introducing a loop. I’d love to know if there is a better approach.

      1. DANIEL CHOTZEN

        I agree with rob,
        that was the first thing that popped into my head when I saw your script
        you have your sheet names “hardcoded” in your example when you load each table

        how else will you load the excel without “hardcoding” the sheet name?

        the only way I know of getting sheet names included in the excel file is if you connect to the excel file via ODBC/OLEDB connection. and then use “sqltables statement”

Leave a Reply