Hitachi Vantara Pentaho Community Forums
Results 1 to 5 of 5

Thread: How to make Start Row dynamic in Excel Input

  1. #1

    Question How to make Start Row dynamic in Excel Input

    Hi

    I am using excel input to get the data from excel.
    My problem is i am doing some processing in previous step to get the row no. from which i have to get the data from excel.
    I've stored that number in variable RI.
    Now if i give RI or %RI% as start Row in excel Input then it is not able to process it correctly. Every time it is giving wrong ouput. It is giving data from 1st row. If i right click on excel input to see the detail then it is showing 0 as start row instead of RI as i've previously written.
    can any one please let me know how can it be done ...how can we make start row as dynamic instaed of hard coded value.

    Thanks

  2. #2
    Join Date
    May 2006
    Posts
    4,882

    Default

    Do you set the value of the variable in another transformation than the one where you're reading from Excel?

    Regards,
    Sven

  3. #3

    Default

    Hi

    i've tried it by two methods:

    1. In the previous transformation i am getting many rows which contains the startrow numbers (storing it in variable RI, this is not environment variable). i am using copy rows to result.
    after that i am running job which is executing for each input row. this job contains one transformation which is reading the startrow number one by one using Get rows from result. this transformation now reads the excel and i am suppliying the start row as RI but its not working.

    2. Instead of the above kind of looping i've tried in only one transformation also. in one text file i have stored the start row no and same transformation is reading the input text file , reading the start row number and suppliying this start row no as startrow of excel input.

    So by both methods i am not able to get the data.

    Thanks for replying.

  4. #4
    Join Date
    May 2006
    Posts
    4,882

    Default

    For 2) You cannot reliably set and use variables in the same transformations.

    For 1) You're doing something wrong, you can only pass 1 row to a "set variable" step per transformation. So what you do with your RI is not that clear to me.

    Maybe you can supply us with a small example of what you want to do.

    Regards,
    Sven

  5. #5

    Default Files attached

    Hi

    Please see the attached file.Look Method1.kjb and Method2.ktr.

    In both upload.ktr and Method2.ktr , i am tring to gining variable RI in excel Input start row but each time it is reset to 0.

    Thanks for your help. Let me know where i am wrong.
    Attached Files Attached Files

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.