Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I have written the following line in my load script
IF(CL_OBAL>0 and (CL_OBAL-CL_ADJUS)=0 AND CL_CBAL=0,-1)AS NOs
Though the script is nut I do not get the desired results(Nos as negative figure) Pls help me whether there is a better way of writing the code
try using nested if statements for each condition.
what are some sample values for CL_OBAL , CL_ADJ, and CL_CBAL ?
you might need to round to integers first...
IF(CL_OBAL>0 and round(CL_OBAL)=round(CL_ADJUS) AND CL_CBAL=0,-1)AS NOs
or if there are 2 decimals
IF(CL_OBAL>0 and round(CL_OBAL*100)=round(CL_ADJUS*100) AND CL_CBAL=0,-1)AS NOs
and check out:
Maybe your fields have Nulls instead of zeros. In this case try something like
if(len(CL_CBAL)=0
or
if(IsNull(CL_CBAL), ...
What's your data?
What's your desired result?
can you please share your with sample data so that we can help you
This is more towards data quality so scripts need to be modified as per the requirements of data
it would be great if you can share the sample qvw for further help