Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Need help on this loop?

Hi Folks,

I have a business like ABC,XYZ,KKK,MMM every business having the data from apr-2014 to mar-2015.and each business is coming from one table.

here for each business i am using the loop here.

for each vBusiness in ABC,XYZ,KKK,MMM

call new_business(startdate,business,tablename,enddate)

next vBusiness

I have a each call statement for each business.i want to generate the data in loop.

2 Replies
maxgro
MVP
MVP

for each vBusiness in 'ABC','XYZ','KKK','MMM'

trace $(vBusiness);

table_$(vBusiness):

load

  '$(vBusiness)' as business,

  date(makedate(2014,4) + rowno()-1) as date

AutoGenerate

  makedate(2015,3,31)-makedate(2014,4)+1;

STORE * from table_$(vBusiness) into table_$(vBusiness).qvd (qvd);

drop table table_$(vBusiness);

next;

Not applicable
Author

Hi,

Thanks for ur reply

here i have the call statement

i need to execute that call statement for each business.

like below

let startdate='01-04-2014';

let enddate='01-04-2015';

I have these business- ABC,XYZ,KKK,MMM

Here for each business is coming from each seperate tables so for each business i have one table here.

assume that ABC- ABC_Tab

                   XYZ- XYZ_Tab

                   KKK- KKK_Tab

                   MMM - MMM_Tab

call new_business(startdate,ABC,ABC_Tab,enddate)

call new_business(startdate,XYZ,XYZ_Tab,enddate)

call new_business(startdate,KKK KKK_Tab,enddate)

call new_business(startdate,MMM,MMM_Tab,enddate)

next vBusiness