Skip to main content
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
Showing results for 
Search instead for 
Did you mean: 

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
Partner Ambassador/MVP
Partner Ambassador/MVP

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