Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I am writing the below expression in script.. but my expression is not working..Can you please tell me where i am missing out..
if(Country='Brazil' and Batch_Code='U',
if(Strategic_Part='Tubes' and [U-D_NL9s]<>0 ,sum(mat_con_qua)*(-1)*sum([U-D_NL9s])*1.055,0)) as test
Thanks,
Bharat
Try this
if(Country='Brazil' and Batch_Code='U',
(Sum(if(Strategic_Part='Tubes' and [U-D_NL9s]<>0, mat_con_qua))*-1)*(sum([U-D_NL9s])*1.055),0) as test
hello
what does not working mean ?
error ?
wrong result ?
Hi,
did you add a GROUP BY at the end of the LOAD ?
I am getting as invalid expression
Yes i have added group by..
Take -1 out of parenthesis
Please find my code so that it will be easy for you.
Hi,
Tried by removing -1 but still same error
what are you trying to calculate using this:
sum(mat_con_qua)*(-1)*sum([U-D_NL9s])*1.055
why multiplying by -1 and 1.055 ?
in you are in a load and want to do a sum, I would write
sum(
if(Country='Brazil' and Batch_Code='U',
if(Strategic_Part='Tubes' and [U-D_NL9s]<>0 ,mat_con_qua)*(-1)*U-D_NL9s])*1.055,0)) as test
because with you syntax, you mix row level treatement (the if clause) and group treatmenet (sum)