You can group the result of your SAQL query by DateTime and DateOnly fields.
q = group q by 'CloseDate';
CloseDate can be DateTime or DateOnly. You can also group by date parts. For example, you can group orders by year and then month.
q = group q by year('OrderDate'), month('OrderDate');
You can use the DateTime or DateOnly field to cogroup two datasets. For example, you can group two datasets by year.
a = load dataset1;
b = load dataset2;
c = group a by year('CloseDate'), b by year('CloseDate');
e = foreach c generate year(a.'CloseDate') as 'CloseDate A', year(b.'CloseDate') as
'Close Date B', sum(a.Amount) as 'Sum of Amount';