Skip to Content

Isnull function not working for Date

Hi All,

Could you please let me know if the Isnull function in a calculated Column will work for the Date Field.

For example: I have a Field A with Date Type as Date, I created another Calculated Column with formula "isNull(Field A)". If I have a null value then the calculated column should show as 1 else as 0, right? But I'm getting 0 in spite they are Null Or populated.

Attaching a test view which I created with the same formula

I'm currently using HANA2.0 SPS 2 version

datetype.png (7.1 kB)
Add comment
10|10000 characters needed characters exceeded

  • We don't see how you've defined the calculated column, how the data looks like before it reaches the calculation or directly afterwards.

    As usual, don't tell just tell us a story but show the code.

  • Sorry for not being so elaborate.

    Below is the snapshot which shows the details of my issue.

    Snapshot of the base table.

    base-table.png

    Snapshot of the Calculated Column

    cc.png

    Snapshot of view output

    cv-output.png

    So in the calculated Column "isnull", I have used the code isnull("CalDate"). In my base table, i have 2 records populated, one with CalDate as null and another record with actual date populated. But my view output for the calculated column shows 0 for both the records.

    please let me know if you need anymore details.

    base-table.png (10.7 kB)
    cc.png (18.8 kB)
    cv-output.png (23.1 kB)
  • I just tried to reproduce this on SP12 and couldn't. ISNULL() delivers the correct result for my example.

    You may want to open a support incident for this, so that the problem can be analysed in more detail.

  • Get RSS Feed

1 Answer

  • Dec 04, 2017 at 09:31 AM
    -1

    Hello, Srinivasa First I cannot reproduce this issue on HANA 1.0 SP12 Version. I suggest that you could check your issue from below list.

    1. Could you check your Calculated Column type, please? boolean is correct.
    2. Could you check whether the column that your Calculated Column using is correct, please? I mean isnull("column") whether the column is that you really want to use. Maybe there a few column called CalDate.
    3. If you can exclude possibility above that could be the HANA version issue. thanks
    Add comment
    10|10000 characters needed characters exceeded

    • Hi Richard,

      I checked my data type for the calculated column and its nvarchar with length 2. I also tried with Boolean but still the same result. The column which I used in the calculated column is right. That's the base table field which has the date value and a null value.