Hitachi Vantara Pentaho Community Forums
Results 1 to 8 of 8

Thread: Merging fields?

  1. #1
    Join Date
    Feb 2011
    Posts
    840

    Default Merging fields?

    so, I know how to split and/or cut fields... but what if I want to "glue" them back together? say field A has "123" and field B has "456", and I want field C to have "123456", and so on...
    Join us on IRC! =)

    Twitter / Google+ / Timezone: BRT-BRST
    BI Server & PDI 5.4 / MS SQL 2012 / Learning CDE & CTools
    Windows 8 64-bit / Java 7 (jdk1.8.0_75)

    Quote Originally Posted by gutlez
    PLEASE NOTE: No forum member is going to do your work for you. We will help you sort out how to do a specific part of the work, as best we can, in the timelines that our work will allow us.

    I'm no expert.Take my comments at your own risk.

  2. #2
    Join Date
    Jun 2010
    Posts
    114

    Default

    May be using Java Script step and do something like..
    C = A + ( B * 1000);
    or you could use Caluculator step and specify the Field A,B and, for Calculation column, specify the Calculation type
    Thanks,
    Om
    ----------------------
    Spoon version -4.4.0

  3. #3
    Join Date
    Feb 2011
    Posts
    840

    Default

    uh... sorry, I shouldn't have used numbers. fields A and B are strings. I thought about using MJSV, but so much people here already told me to avoid it...
    Join us on IRC! =)

    Twitter / Google+ / Timezone: BRT-BRST
    BI Server & PDI 5.4 / MS SQL 2012 / Learning CDE & CTools
    Windows 8 64-bit / Java 7 (jdk1.8.0_75)

    Quote Originally Posted by gutlez
    PLEASE NOTE: No forum member is going to do your work for you. We will help you sort out how to do a specific part of the work, as best we can, in the timelines that our work will allow us.

    I'm no expert.Take my comments at your own risk.

  4. #4
    Join Date
    Nov 2008
    Posts
    777

    Default

    If the fields are strings, the "A + B" operation of the Calculator Step should simply concatenate the strings. Something that simple is not worth the overhead of Javascript.
    pdi-ce-4.4.0-stable
    Java 1.7 (64 bit)
    MySQL 5.6 (64 bit)
    Windows 7 (64 bit)

  5. #5
    Join Date
    Feb 2011
    Posts
    840

    Default

    they are, indeed, strings. but they sometimes contain numbers - and that's when all goes bazinga.
    Join us on IRC! =)

    Twitter / Google+ / Timezone: BRT-BRST
    BI Server & PDI 5.4 / MS SQL 2012 / Learning CDE & CTools
    Windows 8 64-bit / Java 7 (jdk1.8.0_75)

    Quote Originally Posted by gutlez
    PLEASE NOTE: No forum member is going to do your work for you. We will help you sort out how to do a specific part of the work, as best we can, in the timelines that our work will allow us.

    I'm no expert.Take my comments at your own risk.

  6. #6
    Join Date
    Jun 2010
    Posts
    114

    Default

    (even though they are numbers)I think you can specify the value type as string
    Thanks,
    Om
    ----------------------
    Spoon version -4.4.0

  7. #7
    Join Date
    Nov 2008
    Posts
    777

    Default Bazinga?

    It worked fine for me.

    Name:  Bazinga.png
Views: 34
Size:  18.4 KB
    pdi-ce-4.4.0-stable
    Java 1.7 (64 bit)
    MySQL 5.6 (64 bit)
    Windows 7 (64 bit)

  8. #8
    Join Date
    Feb 2011
    Posts
    840

    Default

    hmmm yeah, it seems to work. I'm still wondering what'll be the least troublesome way to solve the bigger problem, but this should help a little. Thanks Om!

    Darrel, sorry! I had completely forgotten about specifying the field type on Calc step! Thanks =)
    Join us on IRC! =)

    Twitter / Google+ / Timezone: BRT-BRST
    BI Server & PDI 5.4 / MS SQL 2012 / Learning CDE & CTools
    Windows 8 64-bit / Java 7 (jdk1.8.0_75)

    Quote Originally Posted by gutlez
    PLEASE NOTE: No forum member is going to do your work for you. We will help you sort out how to do a specific part of the work, as best we can, in the timelines that our work will allow us.

    I'm no expert.Take my comments at your own risk.

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.