Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a sql query as given below :-
Sum(Amount) from table where A=1 AND B=1 AND C=1 AND(X=NA OR Y=NA OR Z=NA)
How can I write this sql query in my SET Analysis expression?
Hi Anees,
I would suggest creating a flag in your script and then using this in your set analysis.
Load *,
If(A=1 AND B=1 AND C=1 AND(X='NA' OR Y='NA' OR Z='NA'),1) as %Flag
from....
Sum({<%Flag={1}>} Amount)
Hope that helps
Joe
Se if this can be used, will be simpler if can be used in your situaiton-
=Sum(if(A=1 and B=1 and C=1 and (X='NA' or Y='NA' or Z='NA'),Amount))
try
sum({$ <A={1},B={1},C={1}>*(<X={NA}>+<Y={NA}>+<Z={NA}>)} Amount)
Thanks a bunch max 🙂
Now it is working as per our requirement.