on 02-07-2018 9:37 AM
Hi Experts,
I created a Calculated column with logic of
set value of calculated column = 0 or column value when the date is between the range of two dates and also check the QTY is null or not.
Code
ISNULL(CASE ( "SALE_DATE_KEY" >= "NEXT_MONTH_BEGIN_DATE_KEY" AND "SALE_DATE_KEY" <= "NEXT_MONTH_END_DATE_KEY" , "QTY" ,0))
But it throws an ERROR.
Here it have to check the QTY value if the QTY is null it has to be set to 0 other the QTY value has been set.
any suggestions!!!
could you use the coalesce function ... so it returns the first non null value or your default zero, for example:
Coalesce(QTY, 0)
Then wrap your other logic around it...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
if("SALE_DATE_KEY" >= "NEXT_MONTH_BEGIN_DATE_KEY" AND "SALE_DATE_KEY" <= "NEXT_MONTH_END_DATE_KEY" ,coalesce( "QTY" ,0), 0)
should return 0 if QTY is null , or 0 if the condition is false. Most likely your null is not a null, do you have a string "Null" or a null value? (represented as ? in HANA)
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.