Hitachi Vantara Pentaho Community Forums
Results 1 to 5 of 5

Thread: How do you subtract from a date in reporting?

  1. #1
    Join Date
    Apr 2007
    Posts
    2,010

    Default How do you subtract from a date in reporting?

    Hi,

    This should be simple, but i just can't find any way to do it. I have a date, and I want to subtract one from it. OpenFormula doesnt work, so is there any other way?

    Dan

  2. #2
    Join Date
    Mar 2003
    Posts
    8,085

    Default

    Yesterday:

    =DATEVALUE(NOW() - 1)

    OpenFormula does work, but after you made a computation, you end up with a number, so you have to convert it back into a date. In 3.6 and later, you also have a DATETIMEVALUE(..) function as the DATEVALUE function cuts on the time portion of a timestamp.
    Get the latest news and tips and tricks for Pentaho Reporting at the Pentaho Reporting Blog.

  3. #3
    Join Date
    Apr 2007
    Posts
    2,010

    Default

    Ah, ok excellent, thanks. I did check the date functions on the wiki but I didnt twig from the description!

  4. #4
    Join Date
    Jan 2013
    Posts
    101

    Default

    Hey Taqua,

    How do I subtract an hour from the NOW() function?

    I tried =DATETIMEVALUE(NOW() - 1) but that doesn't work. Any help would be appreciated. Trying to use a previous 1 or 2 hour window as a starting datetime in the report. It's working the same as the DATEVALUE.

    Mike

  5. #5
    Join Date
    Apr 2014
    Posts
    3

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.