Hitachi Vantara Pentaho Community Forums
Results 1 to 4 of 4

Thread: variables/parameters

  1. #1
    Join Date
    Mar 2013
    Posts
    148

    Default variables/parameters

    Hi,

    I have 3 queries with union and i am trying to pass parameters like this

    for example:

    select a,b,c,date from x where date between ? and ?
    union
    select a,b,c,date from y where date between ? and ?
    union
    select a,b,c,date from z where date > ?

    Here ? has to be replaced with date values like in first query has to be replaced with these values 2000-01-01 and 2001-12-31
    in second query has to be replaced with these values 2000-01-01 and 2001-12-31
    in third query has to be replaced with these values 200-01-01

    I have to set only two variables start_date and end_date.

    How can i do this with PDI?

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

    Default

    With Get Variable you are allowed to retrieve the same parameter value more than once.
    Attached Images Attached Images  
    So long, and thanks for all the fish.

  3. #3
    Join Date
    Mar 2013
    Posts
    148

    Default

    Thank u Marabu..

    If i wanted to run in the command line passing with these start_date and end_date variables?

    sh pan.sh -file=/pathoffile/test.ktr --level=Detailed

    Quote Originally Posted by marabu View Post
    With Get Variable you are allowed to retrieve the same parameter value more than once.

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

    Default

    Don't forget to define the parameters in the transformation settings.
    You can check the available parameters: sh pan.sh -file=/pathoffile/test.ktr -listparam
    Now provide values for the parameters: sh pan.sh -file=/pathoffile/test.ktr -param:start_date="2000-01-01" -param:end_date="2001-12-31"
    Attached Images Attached Images  
    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.