Skip to main content
Question

Published parameter based on another published minus 1


Forum|alt.badge.img

Hi all

Im trying to super optimize a workbench I have that reads a bunch of data from a mssql database, the workbench has 2 published parameters that i use to set years in the "Where" clauses of readers. both parameters have years as values, the parameters are

$(year)

$(year_minus_1)

Is there any way to base the parameter $(year_minus_1) on $(year) and then minus one year. if the value of $(year) is 2017 the value of $(year_minus_1) should be 2016.

Is it possible to do this so you only have to input 1 parameter?

I know its not a big thing but it would make the running of the workspace every year easier for other people running it.

2 replies

lau
Forum|alt.badge.img+3
  • March 15, 2018

You can use a python script parameter (year_minus_1) and set it like this:

previousYear = int(FME_MacroValues['year'])-1

return previousYear


Forum|alt.badge.img
  • Author
  • March 15, 2018
lau wrote:

You can use a python script parameter (year_minus_1) and set it like this:

previousYear = int(FME_MacroValues['year'])-1

return previousYear

Awesome, that did just the trick :)

Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings