Hitachi Vantara Pentaho Community Forums
Results 1 to 5 of 5

Thread: Database lookup and Stream lookup issue

  1. #1
    Join Date
    Dec 2015
    Posts
    7

    Default Database lookup and Stream lookup issue

    Hi,

    I am pretty new to PDI. I am looking for help on Lookup in Pentaho.

    I have source data set like
    source table
    Col1
    10
    20
    30

    Below is Lookup Dataset- I need to perform NULL handling on lookup table columns Col1 and Col2, like
    If Col1 is NULL then -1
    If Col2 is NULL then -2

    Lookup steps, If source.Col1 Between lookup.Col1 and lookup.Col2 then Col_PK
    lookup table
    Col1, Col2, Col_PK
    1 10 111
    11 20 222
    21 30 333

    I can not use database lookup because it would not allow me to perform pre-lookup activity.
    Please help on this, thanks in advance.

    Thanks,
    Santosh Rai

  2. #2
    Join Date
    Dec 2015
    Posts
    7

    Default Range Lookup

    Quote Originally Posted by marabu View Post
    You can't use variable expressions to specify fieldnames in Database-Lookup.
    Your variables would keep their values between rows, anyway.
    Just replace your Database-Lookup by a Stream-Lookup fed by a Table-Input.
    You can use your variables in the SELECT statement of that Table-Input step, then.
    Hi,

    How can we use range lookup in Stream Lookup step?

    Thanks,
    Santosh

  3. #3
    Join Date
    Dec 2015
    Posts
    7

    Default Range look up

    Hi,

    How can we perform range lookup using 'Stream lookup' step?

    Actually, my lookup data is coming from a different Stream..and lookup should be perform on range.

    E.g

    If Source.Col1 >= lookup.Start and Source.Col1 < lookup.End THEN Populated KEY for that particular range.

    Thanks in advance!!

    -Santosh

  4. #4
    Join Date
    May 2014
    Posts
    358

    Default

    You can't. If your data sets are ordered, you can use Merge join and then a Filter as the next step. I'd recommend sticking with the DB lookup in this case, though.

  5. #5
    Join Date
    Dec 2015
    Posts
    7

    Default

    Quote Originally Posted by Lukfi View Post
    You can't. If your data sets are ordered, you can use Merge join and then a Filter as the next step. I'd recommend sticking with the DB lookup in this case, though.
    Hi,

    My problem is, we need to do derivation and then use that data for range look up.

    Thanks

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.