Hitachi Vantara Pentaho Community Forums
Results 1 to 4 of 4

Thread: Identify duplicate column value from single row

  1. #1

    Default Identify duplicate column value from single row

    Hi All,

    How to identify duplicate column values in a single row? For instance, my input looks like this

    id type_1 name type_2 company type_3 address
    1 CON xxxxx CON xxxy NOC xxxxxxxx

    I need to identify how many times "CON" repeated?

    Cheers,
    Harris

  2. #2
    Join Date
    Apr 2008
    Posts
    1,770

    Default

    I would create 3 new fields and populate each of them with 1 or 0 depending if the substring is the same as "CON".
    Then do a sum of those 3 new fields and check the result.
    If it's 0, 1, 2 or 3.
    -- Mick --

  3. #3
    Join Date
    Apr 2008
    Posts
    4,374

    Default

    Normalize it to:

    id type_num type
    1 1 CON
    1 2 CON
    1 3 NOC

    and then it should be pretty easy to tell how often each type code is repeated within an id

  4. #4
    Join Date
    Feb 2013
    Posts
    530

    Default

    Hi,
    Please find the attachments.

    count.jpg
    test.ktr


    :-)
    - Sadakar Pochampalli

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 - 2017 Pentaho Corporation. All Rights Reserved.