Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
evansabres
Specialist
Specialist

Error in Script for Loop

Hello -

I am creating an application using an .xlsx file that has 82 different sheets. I want to create a script that will allow me to access all 82 sheets.

Currently, my script is as is:

// ====================Broadcast Intervals Table ====================

DIRECTORY 'Q:\qlkvw\prod\data\digital\Nielsen\Ratings';

LET vStartSheetNum = 1;
LET vEndSheetNum = 82;
Let vExcelFileName = 'Broadcast Intervals';

//GENERATE EMPTY TABLE
INTERVALS_TABLE:
LOAD
'' AS TEST1
AUTOGENERATE (0);
FOR index = vStartSheetNum TO vEndSheetNum

CONCATENATE(INTERVALS_TABLE)
LOAD
GameDate,
Time,
Rating,
Share,
Households
FROM [$(vExcelFileName).xlsx] (ooxml, embedded labels, table is [Game $(index)]);
NEXT

However, when I run the script, I get the following error message:

Script line error:

FOR index = vStartSheetNum TO vEndSheetNum

Please help.

Thank you.

1 Solution

Accepted Solutions
evansabres
Specialist
Specialist
Author

I found my entirely dumb error.

Please ignore this post

View solution in original post

1 Reply
evansabres
Specialist
Specialist
Author

I found my entirely dumb error.

Please ignore this post