# How to set variables and use it on transformation job

**URL:** <https://matillioncommunity.discourse.group/t/how-to-set-variables-and-use-it-on-transformation-job/1598>\
**Category:** Matillion ETL\
**Created:** [December 24, 2021, 8:52am UTC](https://matillioncommunity.discourse.group/t/how-to-set-variables-and-use-it-on-transformation-job/1598 "2021-12-24T08:52:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![DK852652](https://avatars.discourse-cdn.com/v4/letter/d/47e85d/32.png) [@DK852652](https://matillioncommunity.discourse.group/u/DK852652)\
**Post date:** [December 24, 2021, 8:52am UTC](https://matillioncommunity.discourse.group/t/how-to-set-variables-and-use-it-on-transformation-job/1598/1 "2021-12-24T08:52:32Z")

</div>

Hi, all.

​

I would like to know how to set variables and use it on transformation job.

​

As of orchestration job, there is Python Script component, so I can define some variable and give it to next component as a.job variables.

But as of transformation job, there is no component which can define variables like Python Script component.

​

What I would like to do is below.

1. Define '$​start\_date' which will be the before 90 days from today, as a string and format is like '20210924'.

I could define like this on orchestration job by Python.

&nbsp;

2. I would like to use '$​start\_date' in SQL component like this.

&nbsp;

SELECT

\*

FROM

test

WHERE

start\_date = ${start\_date}

&nbsp;

If there is something component like Python Script on transformation job, or there is some different ways, please let me know.

&nbsp;

Thank you.

---

<div class="post-metadata">

**Author:** ![KevinH](https://avatars.discourse-cdn.com/v4/letter/k/4af34b/32.png) [@KevinH](https://matillioncommunity.discourse.group/u/KevinH)\
**Post date:** [December 28, 2021, 5:09pm UTC](https://matillioncommunity.discourse.group/t/how-to-set-variables-and-use-it-on-transformation-job/1598/2 "2021-12-28T17:09:31Z")

</div>

I've gotten caught up by this before. There is a solution, I think, but it isn't super-obvious...

&nbsp;

First, in your Orchestration Job, assign values to some variables (e.g., using Python Script component as you described.)

&nbsp;

Then, set up a Transformation Job **with job variables** , to be called by your Orchestration Job.

&nbsp;

Then, in your Orchestration Job, add a "Run Transformation" component, and look at the Properties of the Run Transformation Component. See "Set Scalar Variables" and "Set Grid Variables" -- these are what you can use to pass the values of your "Orchestration Job variables" to you "Transformation Job variables."

---

<div class="post-metadata">

**Author:** ![DK852652](https://avatars.discourse-cdn.com/v4/letter/d/47e85d/32.png) [@DK852652](https://matillioncommunity.discourse.group/u/DK852652)\
**Post date:** [January 4, 2022, 9:54am UTC](https://matillioncommunity.discourse.group/t/how-to-set-variables-and-use-it-on-transformation-job/1598/3 "2022-01-04T09:54:03Z")

</div>

Dear Kevin

&nbsp;

Happy New Year and thank you for your kind advise.​

You mean, on transformation job, I need to define Job variables like 'start\_date' first and write it on SQL component like '${start\_date}' right??

&nbsp;

I'm gonna try tomorrow and I'll let you know how it works.

&nbsp;

Sincerely

&nbsp;

---

<div class="post-metadata">

**Author:** ![DK852652](https://avatars.discourse-cdn.com/v4/letter/d/47e85d/32.png) [@DK852652](https://matillioncommunity.discourse.group/u/DK852652)\
**Post date:** [January 6, 2022, 6:45am UTC](https://matillioncommunity.discourse.group/t/how-to-set-variables-and-use-it-on-transformation-job/1598/4 "2022-01-06T06:45:20Z")

</div>

Dear Kevin

&nbsp;

Hi.

Like I wrote 2days ago, I tried to give some variables to "Run Transformation" component on orchestration job.

As a result, it was successful and this is what I wanted to do!!

&nbsp;

Thank you for your advise and I hope it will useful for matillion user.

&nbsp;

Thank you.

&nbsp;
