LAE

Welcome to the LAE community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Discussions

Members

Resources

Events

 View Only
  • 1.  Datatypes not converting

    Employee
    Posted 12-15-2010 09:41

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: joygupta

    Hi,

    I have numeric values in string type column. I have tried to change that with following but it still returns NULL value instead of expected result of 0.0


    override emit if isDigit('CCT_CURRENT_MTHLY_AMT') == false then 0.0 else double('CCT_CURRENT_MTHLY_AMT') as "CCT_CURRENT_MTHLY_AMT"


    Its same for integer and double values, returning null..Can someone help?

    Thanks,

    Joy


  • 2.  RE: Datatypes not converting

    Employee
    Posted 12-20-2010 00:36

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: sgolding@mda-data.com

    Hi Joy,

    Try:

    override emit
    if isDigit('CCT_CURRENT_MTHLY_AMT') == false or
    'CCT_CURRENT_MTHLY_AMT' == null or
    trim('CCT_CURRENT_MTHLY_AMT') == "" then
    0.0
    else
    double('CCT_CURRENT_MTHLY_AMT') as "CCT_CURRENT_MTHLY_AMT"

    If 'CCT_CURRENT_MTHLY_AMT' is blank or null then it is considered a valid digit value and converts as double(null) or double("") which is null . By catching values that are nulls or blanks in the first "if statment" branch it will convert to "0.0"

    Regards,

    Stephen