Qlik Community

Qlik Sense Data Connectivity

Discussion board where members can learn more about Qlik Sense Data Connectivity.

miguelcunha
Contributor

Qlik Sense Load SP based on other SP result

Hello guys,

I have two stored procedures: the first one results in a list of all stores of a company, having ID and Name.

The second one returns all the sales of the company having storeID, TransactionID and value.

The second SP receives as parameter the storeID.

Is is possible to load the first stored procedure and for each store that it returns, use it to load the second stored procedure usign the storeID?

I'd like to make something like this:

Load SP_stores;
     For each ID in

          LOAD

          *;

          SQL exec SP_Stores;

     SQL exec SP_Salles ID;

As I am new in qlik I'm not sure about the nomenclature.


Is this possible? Can you please help me?

NOTE: The tables i'm using are way more complex, but I made them this way just to make it easier to understand.

Thanks in advance,

Miguel Cunha

1 Solution

Accepted Solutions
felipedl
Valued Contributor III

Re: Qlik Sense Load SP based on other SP result

Hi Miguel,

Try something like this:

SP_Stores

Load

LOAD

     *;

SQL EXEC SP_Stores;

for each vID in FieldValueList('ID)'

     SP_Sales:

     LOAD

          *;

     SQL EXEC SP_Salles $(vID);

next;

Felipe.

3 Replies
felipedl
Valued Contributor III

Re: Qlik Sense Load SP based on other SP result

Hi Miguel,

Try something like this:

SP_Stores

Load

LOAD

     *;

SQL EXEC SP_Stores;

for each vID in FieldValueList('ID)'

     SP_Sales:

     LOAD

          *;

     SQL EXEC SP_Salles $(vID);

next;

Felipe.

miguelcunha
Contributor

Re: Qlik Sense Load SP based on other SP result

That's it!

Stores:

    LOAD

      *;

      SQL exec SP_Stores;

     

      for each vID in FieldValueList('ID')

          Salles:

        Load

        *;

       

      SQL exec SP_Sales $(vID);

    next;

   

Thank you very much Felip!

felipedl
Valued Contributor III

Re: Qlik Sense Load SP based on other SP result

No problem Miguel, glad it helped .

Community Browser