cancel
Showing results for 
Search instead for 
Did you mean: 

ISNULL function in SQL Script

mcubilloso
Employee
Employee
0 Kudos

Hi,

I am facing a problem when dealing with NULL values.

I have the folloging line in a proyection

CE_CALC('IF( ISNULL("CRITERIA"), 1, 2 )', DECIMAL(15,2) ) AS "VALUE"

When CRITERIA is not null, the expression value is 2 (as expected), but, when CRITERIA is null, the expression is null also. Is not 1 as expected.

Am I using ISNULL funciton properly??

thansk for the help.

Mauricio

Accepted Solutions (0)

Answers (1)

Answers (1)

mcubilloso
Employee
Employee
0 Kudos

Hi,

ISNULL function in SQL Script for HANA works like this:

isnull

isnull(arg1)

return 1 (= true), if arg1 is set to null and null checking is on during Evaluator run (EVALUATOR_MAY_RETURN_NULL)

you can find interesting documentation at: http://trexweb.wdf.sap.corp:1080/wiki/index.php/NewdbExpressions

finally, what I did was:

CE_CALC(' IF(ISNULL("CRITERIA")=1,''N'',IF("CRITERIA"=''Y'',''Y'',''N'')) ', STRING ) AS "FLAG"

this will respond to three different values for CRITERIA: Y, N (actually, anything different that Y) and NULL.

regards,

Mauricio

former_member191765
Active Participant
0 Kudos

Link is not working...

mcubilloso
Employee
Employee
0 Kudos

Ankur,

you have to be in SAP network (VPN) to access it.

send me an email, and I will send back a PDF with it.

regards,

Mauricio

Former Member
0 Kudos

Hi

I would share PDF with me as well. Please let me know if you would like me to send unan e-mail as well.

mcubilloso
Employee
Employee
0 Kudos

Divya,

sure. just send me an email, and I will respond with the PDF file.

regards,

Mauricio

Former Member
0 Kudos

Hi Mauricio,

Is it possible to also share this pdf with us?

Thank you in advance,

Aris