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 Answer
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;