0

I am trying to count customer and non-customer in my master-DE. Having a customerID means he is an customer.

SELECT 
SUM(CASE WHEN a.customerID is not null THEN 1 ELSE 0 END) AS 'Customer',
SUM(CASE WHEN a.customerID is empty THEN 1 ELSE 0 END) AS 'Lead',
FROM MasterNewsletter

But I am getting that error message "Automation failed due to system error." When I am adding another field I can see that I don´t get results in both columns. Field "customerID" is numeric.

0

Query Studio is very useful, but a little unstable. Sometime I try to run a query and I get "Automation failed due to system error.", the I just click run again and the query works.

But in your case there is a few adjustments you need to do:

  • Remove the last comma (or you will get an error "Field name cannot be blank"
  • In the second SUM, change is empty (is empty is not a valid commando) to is null
  • Remove single quotes from "as field name"

I reproduced a similar scenario and worked in Query Studio

enter image description here

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.