Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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
Partner - Specialist III
Partner - Specialist III

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.

View solution in original post

3 Replies
felipedl
Partner - Specialist III
Partner - Specialist III

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.

Anonymous
Not applicable
Author

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
Partner - Specialist III
Partner - Specialist III

No problem Miguel, glad it helped .