new user - help please?

Options
cmu
cmu
edited February 11, 2022 in Analytics #1
I have a computed column working fine in one query but when deployed to a different query it giving an error of null value can not be converted to string, any tips?

Comments

  • averma
    edited December 31, 1969 #2
    Options
    Hi cmu,
    What do you mean by deploying to a different query? Are you using the same query but with a different data in the database and the new values are null? Could you help me understand your questions a little better?

    Ashwini
    Warning No formatter is installed for the format ipb
  • cmu
    cmu
    edited December 31, 1969 #3
    Options
    HI,

    HAVE WORKED OUT SOME ERRORS BUT STRUGGLING WITH THIS ONE

    I have a computed field which I want to give me the first 29 digits.

    I have used the following syntax
    row["FILE_NAME"]substr(1,29)

    IT WILL NOT RUN BECAUSE SOME COLUMNS HAVE NULL VALUE HOW DO i AM AMEND SO THAT IF THE FILED HAS A NULL VALUE IT PUTS A PLACE HOLDER IN SUCH AS 'NO OUT FILE'

    THANKS
  • Virgil Dodson
    Virgil Dodson E admin
    edited December 31, 1969 #4
    Options
    Hi cmu,

    You should be able to check for null and put some other value in the field instead of performing the substring like below.

    if (row["FILE_NAME"] == null) {
    'NO OUT FILE';
    } else {
    row["FILE_NAME"].substr(1,29);
    }
    Warning No formatter is installed for the format ipb