Hitachi Vantara Pentaho Community Forums
Results 1 to 3 of 3

Thread: Different Job depending on Week Number

  1. #1
    Join Date
    Apr 2008
    Posts
    1,771

    Thumbs up Different Job depending on Week Number (Solved)

    Hi.

    I have set up a job that download files from ftp and process them.
    I need to run this job every week, but depending on the week number, the data flow changes.

    Therefore I thought of creating my data flows and to add, just after the "start", a job that depending on the week of the month (1st, 2nd, 3rd, 4th) activate one specific data flow.

    I thought of using a Java Script which could get the current day of the month and if it's 1-7 then the Job is TRUE (and I can use the Evaluation option to start one flow) otherwise the Job is false (and I use the Evaluation option to start a different flow).

    Unfortunately I don't know if it's possible to do.. my JS skills are abysmal.
    Anyone can help me or suggest better solutions?

    Thanks.
    Mick
    Last edited by Mick_data; 01-14-2011 at 01:05 PM. Reason: Changed Title

  2. #2
    Join Date
    Apr 2008
    Posts
    1,771

    Talking Solved (I think)

    After some googling and reading I entered the following code in the JavaScript Job:
    currentTime.getDate() < 8

    It seems to work!


    Mick
    Last edited by Mick_data; 01-14-2011 at 01:04 PM. Reason: Checked Spelling

  3. #3
    Join Date
    Apr 2008
    Posts
    4,696

    Default

    You could also use the Calculator step to calculate week of the month, and store that in a variable in a transform at the beginning of your job.
    Then use the variable in a job call (eg. Job Filename: /path/to/ProcessFilesForWeek_${WeekNum}.kjb )
    **THIS IS A SIGNATURE - IT GETS POSTED ON (ALMOST) EVERY POST**
    I'm no expert.
    Take my comments at your own risk.

    PDI user since PDI 3.1
    PDI on Windows 7 & Linux

    Please keep in mind (and this may not apply to this thread):
    No forum member is going to do your work for you. We will help you sort out how to do a specific part of the work, as best we can, in the timelines that our work will allow us.
    Signature Updated: 2014-06-30

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.