Search code examples
informaticainformatica-powercenter

initiate a variable dynamically to work in all session on workflow


I am developing an Informaticajob with multiple sessions in one workflow. I need to assign a variable @@AAR with following code

IIF(get_date_part(sysdate,'mm') <= 7, get_date_part(add_to_date(sysdate,'YY',-2),'YY'), get_date_part(add_to_date(sysdate,'YY',-1),'YY') 

)

I am not sure how to get about it, I was thinking on creating a session that assigns the variable, then passes it to the workflow.

This session should be the first session to run in the workflow. but I don't know how to create a session that is not a mapping. What could I do to get this done?


Solution

  • First, you define the variables in your workflow (Workflows -> Edit -> Variables) so the workflow knows about the variables.

    Then, as first Task in your workflow, you take an "Assignment" instead of a session. That's the icon that looks like a calculator. In the assignment, you can assign values to your variables.

    Please note that the variables need to be names "$$..." not "@@..."