Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Employee
Employee

MYSQL Usage of Variable to Loop through 10 databases

We are using MYSQL as the data source.  We have the same 4 tables replicated for 10 different databases (one database for each one of 10 locations). 

We'd like to concatenate all 10 versions of the 4 tables into 4 tables in QlikView and add the database name (database1 through database10) as a new field appended to the records in the data (ie database# as locationid). 

Is it possible to loop through all 10 databases within a single script sequence without having to script and manually refer to each database individually and concatenate into the same set of 4 tables in QlikView?

Julie Kae
1 Reply
MVP & Luminary
MVP & Luminary

Re: MYSQL Usage of Variable to Loop through 10 databases

Yes, it's fairly easy. Take a look at the FOR EACH statement.

-Rob