on 02-12-2012 12:05 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
9 | |
8 | |
6 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.