What is the best way of creating a boolean column based on an integer column?

Answered

Comments

7 comments

  • Gido

    Hello John,

    Depending on your input data set and the values available you will have different possibilities.

    For a data set without negative or null values

    =IF(GT(#CrashData2010!NUMBEROFPERSONSINJURED;0); true; false)

    For a data set which might contain negative or null values it could be helpful to have an additional clearing rule.

    =IF(GT(#CrashData2010!NUMBEROFPERSONSINJURED;0); true; (IF(EQUALS(#CrashData2010!NUMBEROFPERSONSINJURED;0); false; null)))

    Will this work in the way you like?

    2
    Comment actions Permalink
  • John Mulhall

    Hi, thanks for the formula dude.. it crashed the sheet with on both occassions with Sheet contains errors.
    Sheet 'CrashData2010' referenced in 'ProcDataSheet' does not exist in: [NYC_NYPD_CrashData2010, ProcDataSheet, ClusteringSheet1, artifactsheet_4c901ed4ade6440c9b0f19393b6faf8f, artifactsheet_3d1dfd8c1b594ac687308ad385d74453, artifactsheet_04095a6b0a374f19bd7c16ebcfa347a8, artifactsheet_f15a7ed2b1634cef97792bc7b55b5c8c].

    Any further insights on getting a boolean would be most appreciated... Thanks bro!!..

    0
    Comment actions Permalink
  • Joel Stewart

    John - The error reported indicates that there is no sheet named "CrashData2010" in that workbook. It appears that there is a sheet named "NYCNYPDCrashData2010" though.

    Please ensure that a valid Sheet Name is used in the formula.

    0
    Comment actions Permalink
  • John Mulhall

    Joel, thank you for this. It was a silly mistake! I have corrected my error and it works just fine. Will be back with more questions.. I am generating them as a I work an analysis..

    0
    Comment actions Permalink
  • John Mulhall

    Hey Joel.. any other cool commands that are not immediately obvious like GT that a relative newbie like me would like. I presume LT is a command also?

    0
    Comment actions Permalink
  • Gido

    Hello John,

    Right, there is also a command Less Then, called LT (https://documentation.datameer.com/documentation/current/LT). You can find all available functions listed in https://documentation.datameer.com/documentation/current/Datameer+Functions.

    1
    Comment actions Permalink
  • John Mulhall

    Thanks Gido & Joel... the Booleans work for me and have added value to the analysis... onwards we go bro's!

    0
    Comment actions Permalink

Please sign in to leave a comment.