Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi
I have script in the following way. When I execute this script,i encounteres the invalid expression error, specifically in the line
if(isnull(REFERENCE),if(VALUE >0, VALUE)) as NA_VALUE.
Kindly solve this asap.
load
REFERENCE,
agrmt,
if(sum(NA_VALUE)>0,NA_VALUE ,0) as R_V
group by agrmt,REFERENCE
;
Load
REFERENCE,
VALUE,
NA_VALUE,
if(isnull(REFERENCE), 'No Netting Agreement',REFERENCE) as agrmt
;
Load
REFERENCE,
VALUE,
if(isnull(REFERENCE),if(VALUE >0, VALUE)) as NA_VALUE
From A;
Would you be able to post a screenshot of the error?
add a sum in the load with the group by
load
REFERENCE,
agrmt,
if(sum(NA_VALUE)>0,sum(NA_VALUE) ,0) as R_V
group by agrmt,REFERENCE
;
I think try out maxgro solution, he might be right
This is the script I used to test the syntax for my answer (difference with your first post is in bold)
A:
load * inline [
REFERENCE, VALUE
1,0
0,1
];
load
REFERENCE,
agrmt,
if(sum(NA_VALUE)>0,sum(NA_VALUE) ,0) as R_V
group by agrmt,REFERENCE
;
Load
REFERENCE,
VALUE,
NA_VALUE,
if(isnull(REFERENCE), 'No Netting Agreement',REFERENCE) as agrmt
;
Load
REFERENCE,
VALUE,
if(isnull(REFERENCE),if(VALUE >0, VALUE)) as NA_VALUE
Resident A;
Hi, try with this:
if(isnull(REFERENCE) AND VALUE > 0, VALUE) as NA_VALUE
Regards!