Skip to Content
0

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

Jan 30, 2017 at 06:31 PM

319

avatar image

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Kiran Shenvi Feb 10, 2017 at 06:32 PM
0

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

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

Share
10 |10000 characters needed characters left characters exceeded
Mrityunjay Pandey Jan 30, 2017 at 06:48 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded