cancel
Showing results for 
Search instead for 
Did you mean: 

SAP HANA formula expression excludes Null values together with specific value

former_member608099
Discoverer

Hi all,

Filter expression in SAP HANA view excludes also NULL values when you want to exclude only specific value.
For example you get values 'X', 'Y' and NULL for the field.

Filter experssion ("field" != 'X') will exclude not only 'X' as expected but NULL values also and retrives only 'Y'.

Is that a bug or expected behavior?

Thank you,
Alena

Accepted Solutions (1)

Accepted Solutions (1)

KonradZaleski
Active Contributor

Try:

("field" != 'X') or (isnull("field"))
former_member608099
Discoverer
0 Kudos

Thank you, Konrad! That works!

So this is an expected behavior then...

However, honestly, I don't understand the logic, why exclusion of exact specific value excludes also NULL

KonradZaleski
Active Contributor

This is because null is not a value by itself. Null means "unknown", so it's neither equal X nor not equal X - it's just undefined.

Answers (1)

Answers (1)

0 Kudos

I just realized this recently

According to this documentation, this is not unique to HANA Databases

https://launchpad.support.sap.com/#/notes/0001807542