简体   繁体   中英

Evaluate manipulated SYSDATE in Pentaho output

I want to include the specific start and end dates from a date range used within a query as outputs in an excel file separate from the main deliverable in Pentaho Kettle.

The date range in the query is

WHERE Entry_Date BETWEEN ${StartDate} AND ${EndDate}

And I've "parameterized" this in the Transformation Settings (under Parameters Tab) as StartDate = SYSDATE-45 EndDate = SYSDATE

It's not really parameterized, and I could just sub SYSDATE and SYSDATE-45 into the query, but I am trying to get the actual date values to be evaluated through a Get Variables step. How I have it set up, it will only report SYSDATE-45 and SYSDATE, without evaulating them.

Is there a way to convert SYSDATE into a date value in the Get Variables step?

The Parameter section of the PDI doesn't do any sort of query execution. If you have defined any value to a variable, there would be no change in the variable when you are passing to the job/transformation.

In your case, you need to execute SYSDATE and SYSDATE-45 first using either "Table Input Step" and then define the variable, instead of directly assigning SYSDATE to the variable startDate/endDate. The below image might help you out :

在此处输入图片说明

Hope this helps !! :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM