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

loop in include file


Hi Experts,

         i am having three tables, tableA,tableB,tableC..from four different regions say east,west,north,south. each region is having its own database. now  i have to extract data from four regions so we have four connection strings .i wanted to include these four connection strings

in one script file and extract data. how can i achevie this

Note: getting same tables from all the four regions

Thanks in advance

8 Replies
rohit214
Creator III
Creator III

Hi,

At a time you can use one connction string.

so what you can do for example

for getting the north data make a connection string and fetch the required tables and disconnect it in last of the script.

and do rest of the other region so in a single script you can use n no. on connetion script.

ex:

ODBC connection;

Load

f1,

f2,

.

.

.fron north;

disconnect;

ODBC connection

Load

f1,

f2,

from south;

disconnect;

and so on

Regards

Rohit

Not applicable
Author

hi rohit,

   in my case i am calling connection strings from external file through include statement

Not applicable
Author


Hi,

You Can connect to different connection string in a single file

eg: 1.Connect to connectionstring1

     2. Load tables from connectionstring1

     3. Connect to ConnectionString2

     4. Load Tables from ConnectionString2.

       .

......n

Regards,

Joshmi

rohit214
Creator III
Creator III

Not applicable
Author

hi gorge,

   here iam saying about text file not qv file

senpradip007
Specialist III
Specialist III

Try to use for each...Next loop, you may resolve the issue:

1. First load all connections string

2. use for each loop if your table structure is same in all dbs.

miikkaqlick
Partner - Creator II
Partner - Creator II

Hi!

You should write your include file like this:

Let vCon1 = Connection string 1

Let vCon2 = Connection string 2

Then in script

$(vCon1)

Load A

From Con1

$(vCon2)

Load A

From Con2

Br,

Miikka