1

As mentioned in the subject I need to group a string field's data by whether its empty or not empty. How can I do this with SAQL? Do I need to create a boolean variable? and group by that?

1

Managed to figure it out

q = load "mydataset";
q = foreach q generate (case when 'MyField' is null then "no_case" else "got_case" end) as 'Status', count() as 'C';
q = group q by ('Status');
q = foreach q generate Status as 'Status', sum('C') as 'total';
q = limit q 2000;

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.