Hitachi Vantara Pentaho Community Forums
Results 1 to 5 of 5

Thread: Error in formula step

  1. #1
    Join Date
    Nov 2011
    Posts
    4

    Default Error in formula step

    Hello and sorry for my poor english,

    I have an error in a formula step when i want to use the IF operator.

    I want to do the following :

    IF AGEFINAN >= 4
    Then
    AGENEW = 4
    Elses
    AGENEW = AGEFINAN
    En if

    Y use this syntax : IF([AGEFINAN]>=4;[AGEFINAN];4)

    Y have the error below :

    2011/11/18 10:54:54 - T2 - ERROR (version 4.1.3, build 14819 from 2011-02-22 17.04.45 by tomcat) : Erreurs détectées!
    2011/11/18 10:54:54 - T2 - ERROR (version 4.1.3, build 14819 from 2011-02-22 17.04.45 by tomcat) : Erreurs détectées!

    Can you explain me wath y make wrong ? Thank you

    Pascal.
    Attached Images Attached Images  

  2. #2
    Join Date
    Nov 2009
    Posts
    688

    Default

    You have to define your "Type valeur" as a number

    Johan

  3. #3
    Join Date
    Feb 2008
    Posts
    107

    Default

    Your formula is correct, so the error lies elsewhere.

    The lines you pasted only say that there was an error detected. It doesn't say what. The lines before that (you may need to scroll the window) should contain something like :

    Code:
    2011/11/18 11:37:15 - Formula 2.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) : Unexpected error
    2011/11/18 11:37:15 - Formula 2.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) : org.pentaho.di.core.exception.KettleValueException: 
    2011/11/18 11:37:15 - Formula 2.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) : org.pentaho.di.core.exception.KettleValueException: 
    2011/11/18 11:37:15 - Formula 2.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) : Please specify a Number type for field [AGENEW] as a result of formula [IF([AGEFINAN]>=4;[AGEFINAN];4)]
    2011/11/18 11:37:15 - Formula 2.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) : 
    2011/11/18 11:37:15 - Formula 2.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) : 
    2011/11/18 11:37:15 - Formula 2.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) : Please specify a Number type for field [AGENEW] as a result of formula [IF([AGEFINAN]>=4;[AGEFINAN];4)]
    2011/11/18 11:37:15 - Formula 2.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) : 
    2011/11/18 11:37:15 - Formula 2.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) : 
    2011/11/18 11:37:15 - Formula 2.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) :     at org.pentaho.di.trans.steps.formula.Formula.calcFields(Formula.java:230)
    2011/11/18 11:37:15 - Formula 2.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) :     at org.pentaho.di.trans.steps.formula.Formula.processRow(Formula.java:97)
    2011/11/18 11:37:15 - Formula 2.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) :     at org.pentaho.di.trans.step.RunThread.run(RunThread.java:40)
    2011/11/18 11:37:15 - Formula 2.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) :     at java.lang.Thread.run(Unknown Source)
    2011/11/18 11:37:15 - Formula 2.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) : Caused by: org.pentaho.di.core.exception.KettleValueException: 
    2011/11/18 11:37:15 - Formula 2.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) : Please specify a Number type for field [AGENEW] as a result of formula [IF([AGEFINAN]>=4;[AGEFINAN];4)]
    2011/11/18 11:37:15 - Formula 2.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) : 
    2011/11/18 11:37:15 - Formula 2.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) :     at org.pentaho.di.trans.steps.formula.Formula.calcFields(Formula.java:161)
    2011/11/18 11:37:15 - Formula 2.0 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) :     ... 3 more
    2011/11/18 11:37:15 - Formula 2.0 - Finished processing (I=0, O=0, R=1, W=0, U=0, E=1)
    2011/11/18 11:37:15 - Transformation 1 - Transformation 1
    2011/11/18 11:37:15 - Transformation 1 - Transformation 1
    2011/11/18 11:37:15 - Spoon - The transformation has finished!!
    2011/11/18 11:37:15 - Transformation 1 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) : Errors detected!
    2011/11/18 11:37:15 - Transformation 1 - ERROR (version 4.2.1-stable, build 15952 from 2011-10-25 15.27.10 by buildguy) : Errors detected!
    In this case, the previous errors are clear - the solution is to tell the Formula step that the "Value Type" is "Number" from the drop-down list.

    Let me know if that solves it.

    Cheers,
    Paul

  4. #4
    Join Date
    Nov 2011
    Posts
    4

    Default

    Quote Originally Posted by johanhammink View Post
    You have to define your "Type valeur" as a number

    Johan
    Yesss ! Thank you, it's OK now. Y spent more than 2 hours for it. Y tried with "Type valeur" as integer but it failed. It's OK with "number"

    Pascal

  5. #5
    Join Date
    Nov 2011
    Posts
    4

    Default

    Hello,

    I pasted all the lines in error. Ther is no other error line that explains the error, that's why y asked to you some help.

    Thank you.

    Pascal

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.