# Any way to change job variable?

**URL:** <https://matillioncommunity.discourse.group/t/any-way-to-change-job-variable/1500>\
**Category:** Matillion ETL\
**Created:** [October 8, 2021, 8:05am UTC](https://matillioncommunity.discourse.group/t/any-way-to-change-job-variable/1500 "2021-10-08T08:05:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rka1621004583744](https://avatars.discourse-cdn.com/v4/letter/r/ac91a4/32.png) [@rka1621004583744](https://matillioncommunity.discourse.group/u/rka1621004583744)\
**Post date:** [October 8, 2021, 8:05am UTC](https://matillioncommunity.discourse.group/t/any-way-to-change-job-variable/1500/1 "2021-10-08T08:05:08Z")

</div>

Is there a way to change variable values in the orchestration job? Have duration from a task, but it is in milliseconds not seconds. Tried sql script but it does not let me use a SELECT ${variable} / 1000

---

<div class="post-metadata">

**Author:** ![Bryan](https://avatars.discourse-cdn.com/v4/letter/b/db5fbb/32.png) [@Bryan](https://matillioncommunity.discourse.group/u/Bryan)\
**Post date:** [October 8, 2021, 3:58pm UTC](https://matillioncommunity.discourse.group/t/any-way-to-change-job-variable/1500/2 "2021-10-08T15:58:57Z")

</div>

Hi [@rka1621004583744](https://matillioncommunity.discourse.group/u/rka1621004583744)​, I am assuming you have a job variable with a default value that is some millisecond value but then you need to update the value to be the equivalent value in seconds. If that is correct, you can do this a couple different ways. One way would be to use a Python Script component.

The python script would look like the below. In the below example timeval is your job variable with the millisecond value.

import math:

val = int(timeval) / 1000

print(math.trunc(val))

context.updateVariable('timeval', str(val))

I hope this helps!

---

<div class="post-metadata">

**Author:** ![rka1621004583744](https://avatars.discourse-cdn.com/v4/letter/r/ac91a4/32.png) [@rka1621004583744](https://matillioncommunity.discourse.group/u/rka1621004583744)\
**Post date:** [October 11, 2021, 8:36am UTC](https://matillioncommunity.discourse.group/t/any-way-to-change-job-variable/1500/3 "2021-10-11T08:36:02Z")

</div>

Hi. I'll try that. Never written python before, but might as well start learning that code language as well
