Workbench - ODBC - Global Replacement Variables - Main use of and how to use them?

BMJProtoLabs Minnesota ⚪️

I cannot find any example, post, or video that clearly shows what Global Replacement Variables are best used for and how to use them (ideally in the query unless they aren't meant to be used here)?  I think a solid definition of what the difference is between a 'Replacement Variable' and a 'Global Replacement Variable' would help quite a bit as well!


Ex:  Lets say I want to use a Global Replacement Variable to limit multiple Job's query's where clase to include all data since the beginning of 2019, is that a use case for Global Replacement Variables?



FROM dbo.employee

WHERE startDate >= <Global Replacement Variable with correct syntax that reprensents 2019-01-01>


Best Answers

  • TLarsen
    TLarsen ⚪️
    Accepted Answer

    A global replacement variable works just as you've described below.  Both the global and non global replacement variables allow you to store the last item in a sorted field in your data set. 


    The global version allows you to use that stored value in other jobs while the non global version is only accessible in the job it was created in.  


    Additional information about replacement variables, including how to use them, can be found in the 'Connecting to Data using Workbench 5' KB article linked below.  Step 19 gives the details you're looking for. 


  • Matt84096
    Accepted Answer

    What I understand to be the main difference is that a global replacement variable can be accessed across workbench jobs, whereas a replacement variable is limited to the workbench job you're working on. It's true that the documentation is somewhat limited in this area.


This discussion has been closed.