Hitachi Vantara Pentaho Community Forums
Results 1 to 7 of 7

Thread: concatenate columns with different format

  1. #1

    Default concatenate columns with different format

    hey again

    i wana make something and i don't know is it possible in kettle or not

    if i have text file contain the following fields

    ID : integer
    Name : string
    Salary : integer


    and i have another text file contain the following fields:
    Name : string
    Balance : integer



    i wana another text file that has 5 columns contains the following:

    ID Name Salary Balance


    where Name is from the first file and it has the same values in the second file


    i tried merge join but it duplicates Name , also i tried calculator , but the problem is when making hops , a message appear telling me , that different in data format


    is it possible to concatenate different columns together ??

  2. #2
    Join Date
    Oct 2007
    Posts
    235

    Default

    Change one of the name columns either in the source step or with a select values step then do the merge and then do a select values to get just the columns you want.

    input1 -> -> merge -> select
    input2 -> select -^

    Good luck

    Wil

  3. #3
    pstoellberger Guest

    Default

    you can build something like

    File Input 1 \
    > Stream Lookup > File Output
    File Input 2 /

    In this stream lookup you can define "Name" as the key and join it
    If the contents in file1 and/or 2 are not sorted you need to do that before the stream lookup

    if you mean with name duplicate... that there are 2 Name columns after the lookup / join then you can do a Select Values afterwards that selects only the columns you need

  4. #4

    Default

    look this is the error i got :

    The name of field number 1 is not the same as in the first row received: you're mixing rows with different layout. Field [SecndName String(5)<binary-string>] does not have the same name as field [ID Integer(1)<binary-string>]



    i think it's problem is in data types ,

    i make simplified files :

    file 1 => ID, Name
    file 2 => Name, Balance

    i wana to have ID,Name, Balance in the output file

    i create the first hop from file 1 to output and no problem in that


    the previous message appear when making the second hop , i tried to ignore it and run transformation but actually it stops and does not continue

  5. #5

    Default

    i attached the transformation, if you could review it please

    i made like pstoellberger said

    check and tell me weather was it right or wrong

    thanks alot guys
    Attached Files Attached Files

  6. #6

    Default

    Guysssssssssssssssssss , it's ok i got it

    i applied wselwood steps and it works


    thanks alot

  7. #7

    Default

    hey guys again

    i have anothe issue and also i need to concatenate columns , but actually it doesn't work as i want this time

    iam collecting data from different sources , and i have some data replicated in some sources and other not

    i wana also to concatenate specific columns

    but when using join merge

    either i choose INNER , which will display only the common fields

    or FULL outer which won't display the complete row as it won't have matched values in other columns

    how can i display complete data and complete rows ???

    thanks in advance

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.