Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I want to sum the values in several fields into one "sum" field. Here's what I have so far:
LOAD customerID,
product1purchases,
product2purchases,
product3purchases,
(product1purchases+product2purchases+product3purchases) as totalpurchases
from
Hi Sophia, In this case Rangesum would be more appropriate.
PFA the example.
PFA. It should work fine. Can you send me your script please?
That helped! I tested it and found that most of the fields had null values and these were tripping it up. If anyone reads this and has the same issue, here's what my solution was:
LOAD customerID,
product1purchases,
product2purchases,
product3purchases,
(if(product1purchases=1,product1purchases,0)
+if(product2purchases=1,product2purchases,0)
+if(product3purchases=1,product3purchases,0)) as totalpurchases
from
Hi Sophia, In this case Rangesum would be more appropriate.
PFA the example.
Even better, thanks!