Mastering Qlik Sense
by Ralf Becher, Karl Pover, Jason Michaelides, Dilyana Ivanova, David Alcobero, Martin Mahler, Juan Ignacio Vitantonio
Looping
Sometimes, it is necessary to create loops in our scripts. These loops can be either run a fixed number of times or they can run until a certain condition is met.
A real scenario where loops are useful is that of a decentralized environment with multiple databases, and thus multiple database connections. If each database contains the same table structure but the data is different—for example, each database contains data for a specific region—to extract or pull the data, we would need to execute the same SQL statement for each of the databases.
Instead of having n different database connection calls with the same SQL code to extract the data, we can use loops that will contain one call to the database and one SQL code to pull the data. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access