0

Global variable doesn't update when new model is processed

 Hello,

I'm trying to use a conditional to check the most recent run date column in a model and compare it with today's date. I'm hoping to create a crude validation that will email stakeholders and notify them that the model has been updated with the current date's data.

The conditional compares two variables using Equals(). One variable is set to the current date using Date(). The other one is a direct query from the updated model. 

Below is the log from the schedule. todayDate updates properly, however the comparing variable doesn't.

 

 Master Workflow:

 

Set date variable:

 

 Comparison variable querying the model after it's updated:

 

 
Variable values after scheduled update

 

I've also tried using SQL Script node to return the value to the variable but that doesn't work either.  What's weird is when I run this manually, it will update properly. 

Any help will be greatly appreciated, thank you!

3 replies

null
    • Stefano_Sena
    • 5 days ago
    • Reported - view
     said:
     Master Workflow:

    Set date variable:

    Comparison variable querying the model after it's updated:

     The screen shots didn't show up so please see below in order of the quote:

     

     

    Here's also the conditional check:

    Thank you!

      • Eduart_Jazaj
      • 3 days ago
      • Reported - view

        I have replicated the same steps as you with a slightly different approach, and created a schedule as well, I get accurate dates loaded to @Today and @ModelRunDate variables. The correct email gets sent out as well. However, it also depends what model date are you trying to extract form the database and load to your variable (the previous model run date or the current one that is being executed in this master flow). If you are aiming to extract the Model Run Date of the current master flow execution, the best approach to do so is to insert a sql script as shown below, after the Data Model Node, and load the result back to the variable (ModelRunDate). 

       

      It would also be helpful to see the sql script you are using to extract the date shown on your variable modelRunDate. 

      • Stefano_Sena
      • 3 days ago
      • Reported - view

      Hi 

       

      Works perfectly, thank you very much!

Content aside

  • Status Answered
  • 3 days agoLast active
  • 3Replies
  • 18Views
  • 2 Following