Hitachi Vantara Pentaho Community Forums
Results 1 to 3 of 3

Thread: DATEDIF "m" Issue

  1. #1
    Join Date
    Aug 2011
    Posts
    2

    Default DATEDIF "m" Issue

    Using the Formula step in v4.2, I am attempting to use the following formula: DATEDIF(StartDate;EndDate;"m"). My start date = 5/2/2011 and the end date = 4/30/2012. The function is returning 13 months. It is clearly not even 12 months, but 12 months is the result I was expecting. What am I doing wrong? I have tried formatting the date every which way I can think of, and reversing the order of the dates, and still nothing gives me the 12 months that I am looking for. Thanks for any help!
    Last edited by clawlor; 07-31-2012 at 12:14 PM.

  2. #2
    Join Date
    Nov 2008
    Posts
    271

    Default

    This seems a bug. Please consider filling in a jira. In the meanwhile, a javascript step workaround may fit your needs:
    Code:
    var diff = dateDiff(startDate,endDate,"m");
    Cheers
    Andrea Torre
    twitter: @andtorg

    join the community on ##pentaho - a freenode irc channel

  3. #3
    Join Date
    Jun 2012
    Posts
    5,534

    Default

    So long, and thanks for all the fish.

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.