Hitachi Vantara Pentaho Community Forums
Results 1 to 7 of 7

Thread: concat

  1. #1
    Join Date
    Mar 2013
    Posts
    148

    Default concat

    Hi,

    When i am concatenating string and number i am not getting proper number format from the below attachment.

    Name:  frm_data.png
Views: 21
Size:  3.9 KBName:  frm_meta.png
Views: 20
Size:  4.2 KB

    the result is coming like this

    Name:  frm_wrngresult.png
Views: 21
Size:  5.8 KB

    but i want
    123.000|test1
    456.100|test2
    525.220|test4

  2. #2

    Thumbs up

    Hi there,

    You can achieve this with a Concat Fields step quite easily:
    Name:  concatStep.jpg
Views: 19
Size:  22.3 KB

    Here is a copy of an example Transformation for your reference:
    concat.ktr

    I hope this helps!

    Dwayne

  3. #3
    Join Date
    Mar 2013
    Posts
    148

    Default

    ACtually why i am doing in javascript is i have some conditions for that reason i wanted to use it in javascript level.

    Is there any possibility to do in javascript

    Quote Originally Posted by dhughes View Post
    Hi there,

    You can achieve this with a Concat Fields step quite easily:
    Name:  concatStep.jpg
Views: 19
Size:  22.3 KB

    Here is a copy of an example Transformation for your reference:
    concat.ktr

    I hope this helps!

    Dwayne

  4. #4
    Join Date
    Jun 2012
    Posts
    5,534

    Default

    Dwayne is right in pointing you to the Concat step.
    Many Kettle users try to use JavaScript when they shouldn't.

    BTW: MJSV step has no problem to produce the desired output.
    Show your code if you want to learn what you did wrong.

    Name:  whynot.png
Views: 17
Size:  27.8 KB
    So long, and thanks for all the fish.

  5. #5
    Join Date
    Mar 2013
    Posts
    148

    Default

    Please correct me from the below attached ktr

    Quote Originally Posted by marabu View Post
    Dwayne is right in pointing you to the Concat step.
    Many Kettle users try to use JavaScript when they shouldn't.

    BTW: MJSV step has no problem to produce the desired output.
    Show your code if you want to learn what you did wrong.

    Name:  whynot.png
Views: 17
Size:  27.8 KB
    Attached Files Attached Files

  6. #6
    Join Date
    Jun 2012
    Posts
    5,534

    Default

    Code:
    var c = num2str(Number1, "0.000") + "|" + Name;
    So long, and thanks for all the fish.

  7. #7
    Join Date
    Mar 2013
    Posts
    148

    Default

    Thanks a lot..

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.