Hitachi Vantara Pentaho Community Forums
Results 1 to 5 of 5

Thread: Modulus

  1. #1
    Join Date
    Jul 2012
    Posts
    6

    Question Modulus

    Does Kettle support modulus?
    I read it was supported in earlier versions, but I can't find it in the current version.

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

    Default

    The Calculator step doesn't support the modulo operator (A % B), so you will have to do without.
    You also can use a scripting step.
    Attached Images Attached Images  
    So long, and thanks for all the fish.

  3. #3
    Join Date
    Jul 2012
    Posts
    6

    Default

    Thanks for the reply.
    How do you use modulo in the scripting step?
    There is no modulo function in the tree and I can't find any documentation on it.

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

    Default

    This code in step "Modified Java Script Value" will add a field named Modulo to the row:

    Code:
    var Modulo = N % M;
    Don't forget to click on the button "Get Variables" at the bottom of the script editor.

    Some documentation you can find in the samples coming with Kettle.
    You can also visit the Wiki: http://wiki.pentaho.com/display/EAI/...a+Script+Value
    A precious source of information are the blogs of the Pentaho developers and some of the senior members.
    So long, and thanks for all the fish.

  5. #5
    Join Date
    Jul 2012
    Posts
    6

    Default

    Quote Originally Posted by marabu View Post
    This code in step "Modified Java Script Value" will add a field named Modulo to the row:

    Code:
    var Modulo = N % M;
    Don't forget to click on the button "Get Variables" at the bottom of the script editor.

    Some documentation you can find in the samples coming with Kettle.
    You can also visit the Wiki: http://wiki.pentaho.com/display/EAI/...a+Script+Value
    A precious source of information are the blogs of the Pentaho developers and some of the senior members.
    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.