Skip to main content
Announcements
Announcing Qlik Talend® Cloud and Qlik Answers™ to accelerate AI adoption! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
brunolelli87
Creator II
Creator II

Loop throug items on an Excel file.

Hello guys,

I have an Excel file (as you can see below), with 2 columns, that are: Company and Ticker.

CompanyTicker
AZULAZUL4
AZULAZUL3
GOLLGOLL4
GOLLGOLL3
GOLLGOLL11
GERDAUGGBR3
GERDAUGGBR4
GERDAUGGBR11

 

I would like to run a loop in my script, but 1 LOAD looping through Company and another LOAD looping through Ticker?

Is it possible?

 

Thanks

1 Reply
vamsee
Specialist
Specialist

The below solution lets you loop with Company first, then nested loop of Ticket in it.

A:

Load Company, Ticket

From Table A;

Let vCompanyNo=1;
For vCompanyNo= 1 to NoofRows('A')
LET vCompanyLoop= Peek('Company', vCompanyNo-1, 'A');

TRACE with $(vCompanyLoop);

Let vTickerNo=1;
For vTickerNo= 1 to NoofRows('A')
LET vTickerLoop= Peek('Ticker', vTickerNo-1, 'A');

TRACE $(vTickerLoop);

******

Script

*****

Trace $(vTickerLoop) End;

Next

Trace $(vCompanyLoop) End;

Next

Trace Both Loops Completed;