Hitachi Vantara Pentaho Community Forums
Results 1 to 4 of 4

Thread: How can I delimit that a From-Date parameter not to be smaller than 6 month ago?

  1. #1
    Join Date
    May 2012

    Default How can I delimit that a From-Date parameter not to be smaller than 6 month ago?

    I want that my From-Date parameter is not smaller than Today()-180, so if the user input a smaller data, the value must be Today()-180.

    I have defined a hidden parameter FromDatMin = DATEVALUE(TODAY()-180) and I tried to put something like this in the 'Post-Processing Formula' of the FromDat parameter:


    but it doesn't work, my FromDat parameter results <Null>.

    Certainly the Formula Editor screen shows the message "Formula:Not enough data for computation", so the formula itself seems to be wrong.

    Someone can help? Thanks!

  2. #2


    in your query, you can do something like this:

    select * from table where dt >= LEAST(FromDat, current_date() - interval 180 day);

    * current_date() - interval 180 day evaluates to 180 days ago
    * FromDat is the date paramater that the person chose from the date picker
    * the MySQL "LEAST" function will use whichever one is older (smaller)

  3. #3
    Join Date
    Mar 2003


    Is your FromDatMin parameter declared *before* your FromDat parameter? If not, then you wont see a valid result, as parameters are evaluated in order, and your FromDatMin has not been evaluated in that case.

    Btw: You dont need an extra parameter, you can inline everything into the Post-Processing formula.

    Get the latest news and tips and tricks for Pentaho Reporting at the Pentaho Reporting Blog.

  4. #4
    Join Date
    May 2012


    Tthank you again, resolved!

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.