Skip to content
Learn › Clean and shape data › Group and pivot: open the docs menu

Group dates by month, year or weekday in a pivot

In Group & Pivot, a date column in Rows or Columns is grouped by day unless you change its Edit format. Pick a coarser format to total by month, year or weekday. For building the pivot itself, see Group, pivot and unpivot data.

Choose how dates are grouped

When a date column is in Rows or Columns, its edit icon opens an Edit format list that sets how dates are grouped. The default is by day (DD-Mon-YYYY).

Edit formatGroups byResult column type
DD Mon, YYYY HH:MM:SSSecondDate
DD Mon, YYYY HH:MMMinuteDate
DD Mon, YYYY HHHourDate
DD-Mon-YYYY (default)DayDate
YYYY, MonthYear and monthText
YYYY (number icon)YearNumber
MonthMonth name, across all yearsText
YYYY (text icon)YearText
WeekdayDay of the week, across all weeksText
Mon-DD, YYYY HH:MM:SSSecond, written as textText

A format that isn't a date changes the column's type, and the menu says so before you save, for example: "Editing format of column "order_date", changes its type from "Date" to "Text"". A date column in Rows also has a Display Name box.

Example: to total sales by month, put order_date in Rows, set its Edit format to YYYY, Month, and put sales in Values with Sum.

Was this page helpful?

Something wrong? support@mammoth.io