Basically you have 2 options:
- Bucket in a dataflow or recipe
- Bucket in the dashboard. For that you have to write custom SAQL.
In your query insert a line containing "case when" like the following
q = foreach q generate case when orderCountry in ["AUS", "USA", "GBR"]
end as Bucket1,
case when orderCountry in ["USA", "GBR", "IND", "KEN"]
end as Bucket2,
case when orderCountry in ["KEN", "AUS", "IND"]
end as Bucket3;
Then create subqueries to count
result1 = group q by Bucket1;
result1 = foreach result1 generate Bucket1, count() as countBucket1;
result2 = group q by Bucket2;
result2 = foreach result2 generate Bucket2, count() as countBucket2;
result3 = group q by Bucket3;
result3 = foreach result3 generate Bucket3, count() as countBucket3;
And finally union or cogroup the suqueries back together, depending on what you want to do with these numbers.
Hope that helps!