Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Not applicable

Looping multi DBs like PHP

Hello Friends.


I have 2 DBs (CLIENTS, RENT), with two different ODBC connections.


When I try to connect in PHP do the following way:

PHP  SINT

//FIRST ODBC CONECTIONS

NEW() ODBC1;

ODBC1->QUERY("SELECT * FROM CLIENTS.ACTIVES");

while( $A = ODBC->FETCHARRAY()){

     //SECOND ODBC CONECTIONS

     NEW() ODBC2;

     ODBC2->QUERY("SELECT * FROM RENT.DEBTOR WHERE CLIENT_ID = '".$A[ID]."' ");

     BLA BLA BLA

}


PRINT CLIENTS ACTIVES AND RENT DEBTOR....

I can do something similar in QlikView?

2 Replies
jason_michaelid
Honored Contributor II

Looping multi DBs like PHP

I don't know PHP so can't tell what the above code is doing, but what do you want to achieve in QV, exactly?

Not applicable

Looping multi DBs like PHP

Ok.

I solved.

//CONNECT TO DATA BASE 1

ODBC CONNECT TO DATABASE1

SELECT1:

LOAD *;

SQL SELECT * FROM DATABASE1.TABLE1;

//CONNECT TO DATA BASE 2

ODBC CONNECT TO DATABASE2

//LOOP

FOR i=1 TO NoOfRows('SELECT1')

  LET ID=FieldValue('ID',$(i) );

  SELECT2:

  LOAD *;

  SQL SELECT * FROM DATABASE2.TABLE2 WHERE ID=$(ID);

 

NEXT

Community Browser