Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: Relative interval formula "yesterday", not working properly

  1. #1

    Default Relative interval formula "yesterday", not working properly

    Hello,

    in my reports, I am often using relative intervals such as "Today", "Yesterday", "This week", "Previous week", "Last 7 days", etc.

    I have a "Relative date" dropdown menu with indexes, than "post-processing formula" in DATE picker, that overwrite DATE if specific "Relative date" is chosen.

    While most of them are working as they should, I have problem with interval "Yesterday" at the beginning of the month.

    The interval is defined as formula:
    Code:
    DATEVALUE(NOW() - DAY(1));
    However, it returned 30.8. instead of 31.8. when I ran it 1.9. (this friday).

    I am running pentaho 7.1 CE and report_designer 7.1 too.

    Does anybody encountered this problem? Is there any chance how to fix it? Or perhaps, am I doing anything wrong?

  2. #2
    Join Date
    Nov 2009
    Posts
    688

    Default

    Why are you not using YESTERDAY() ?
    The formula DATEVALUE(NOW() - DAY(1)) give you 2 days ago. So when you runs that today (4.9) it gives 2.9
    So then you should use DATEVALUE(NOW() - DAY(0))

Tags for this Thread

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.