Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: pentaho report designer - how to pass parameter inside another parameter in mysql ?

  1. #1
    Join Date
    Jun 2016
    Posts
    5

    Default pentaho report designer - how to pass parameter inside another parameter in mysql ?

    Hi ,

    I am novice to report designer, we want to pass filter as interval -1 day to -3 days
    so there is query in mysql as follows:-
    SELECT DATE(NOW()-INTERVAL 01 DAY)
    so we don't want to directly specify 01 day we want to pass it as parameter.(SELECT DATE(NOW()-${p_day}))
    So for that i have create a temporary table which will store p_day value as 1 and 3.

    But the query is not working.It seems bit challenging to me.We are using this approach because client wants to use different timezones if this is solved hopefully we can use hours in place of days parameter.

    if anyone has any idea about how to execute this please let me know.Or if there is any other solution please help.

  2. #2
    Join Date
    Aug 2016
    Posts
    142

    Default

    You can't use a parameter value in the way you have suggested

    However it works if you use this format

    DATE(NOW()- INTERVAL ${p_day} DAY)

    Then just create a parameter with the name p_day and type integer. The user can then enter whatever number they want.

    This should also work for hours

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.