Hitachi Vantara Pentaho Community Forums
Results 1 to 3 of 3

Thread: compare and match data

  1. #1
    Join Date
    Oct 2012
    Posts
    116

    Default compare and match data

    Hello,
    I am loading data from postgresql database to the Report Designer. Data are in the table and they look like this:
    ID value1 value2
    1 21 185
    2 78 160


    Now what I want..
    I want to check all values in rows from database and match them with types in this table:
    type value1 value2
    type1 <30 >150
    type2 >50 <200


    The result (report) should look like this:

    ID 1 ... type1
    ID 2 ... type2

    Is this possible? I just want few tips or some link, where could I find similar problem.
    Thank you

  2. #2

    Default

    Hi Damegu,

    You can use Database lookup component with help of this you will get above result

  3. #3
    Join Date
    Oct 2012
    Posts
    116

    Default

    Thank you.
    I dont know how to work with Database Lookup, but I started to use "formula" and it seems it will solve my problem.
    But I am not familiar with its syntax.

    All I want to do is this:

    Code:
    if (([value1]<30 AND [value2]>150) THEN [type] = "type1") ELSE
    if (([value1]>50 AND [value2]<200) THEN [type] = "type1") ELSE
    if (([value1]<20 AND [value2]<140) THEN [type] = "type13") ELSE...
    But in "formula" there is not ELSE or THEN.
    Can I use "formula" for these types of conditions?
    Thank you

    EDIT: I found the solution, it seems everything is working now
    Last edited by damegu; 07-17-2014 at 11:11 AM.

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.