Skip to Content

How to pass a NULL Value to a calculation in HANA View?

Hi,

I am working on a Calculative View in HANA modelling and created a new calculation.

It contains a simple if else on which I need to make a distinct count later.

The HANA model is forcing me to pass a somel value in the ELSE part.

var-flag

IF(SomeCondition,dimension_value,'')

intentionally put '' blank in ELSE part to validate the expression.

But because of this certain rows for which it should have been NULL are now getting converted to '' and this impacts the calculations during aggregation like distinct count or average.

Has someone come across this scenario and can suggest an workaround?

Regards,

Kiran Shenvi

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Feb 10, 2017 at 06:32 PM

    The solution which worked for me was to simply pass this keyword NULL and it worked.

    example : if(1>2,'This is true',NULL)

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 30, 2017 at 06:48 PM

    You can try using ISNULL or coalesce function to resolve this.

    Add comment
    10|10000 characters needed characters exceeded