Forum Discussion

hmokkapati's avatar
hmokkapati
Helper II
9 years ago
Solved

Delay Queries

Hello,

 

I have a pbix where I have around 7 queries. Is there a way I can stop queries 2 to 7 to start processing unless i finish Query 1. I can use the Function.InvokeAfter(), but there is no way to know how long the first query would take.

 

More back ground: The need is to get data from Anaplan. Before getting the latest data, the export file in Anaplan has to be refreshed. So, Query1 would be refreshing these files through an API. After this refresh is done, latest data has to be pulled in other queries using other APIs. So the need is to wait until Query1 is finished and then run the other queries when we do "Refresh All".

 

Any pointers appreciated.

 

Thank You,

Harisha

  • To my knowledge it is not possible to let one query start after another one has finished. As it is not possible to influence the order of queries. So the options you have are:

     

    1) make the Function.InvokeAfter-time long enough plus some buffer

    2) allocate your queries into 2 different folders and manually start the refresh of the 1st one and then start the refresh of the other ones manually again

    3) Always refresh twice (this would only work if the data doesn't change in between)

4 Replies

  • ImkeF's avatar
    ImkeF
    Community Champion

    To my knowledge it is not possible to let one query start after another one has finished. As it is not possible to influence the order of queries. So the options you have are:

     

    1) make the Function.InvokeAfter-time long enough plus some buffer

    2) allocate your queries into 2 different folders and manually start the refresh of the 1st one and then start the refresh of the other ones manually again

    3) Always refresh twice (this would only work if the data doesn't change in between)

    • hmokkapati's avatar
      hmokkapati
      Helper II

      Hello Imke,

       

      I think i will go with the first option for now with enough buffer.

       

      Thanks for your response. Appreciate your time.

       

      Thank You,

      Harisha

       

    • hmokkapati's avatar
      hmokkapati
      Helper II

      Hello Imke,

       

       

       

      As a second thought, even if we have queries in different folders and decide to refresh each folder separately how can I achieve the same once the file is published to the Online Service? Any pointers?

       

      Thank You,

      Harisha

      • ImkeF's avatar
        ImkeF
        Community Champion

        Sorry, no - this is not my field.