Say you have order data that looks like this, and want to add additional column for last ordered date of each customer.

First, group the data by Customer ID by following the header menu like following.

The data is grouped by Customer ID.

Then, add a column with mutate. Follow the menu like this.

Mutate dialog will show up. Type in the following expression in the Calculation Editor.

max(`Order Date`)

Since the data is grouped, max(`Order Date`) here means maximum value within each customer, which means the last ordered dates of customers.

Click Run, and you will see the last_order_date column added.

You can ungroup, when grouping is not necessary for further data wrangling any more.

Here is the resulting table with the example data shown above.

Loading...

Here is bar chart showing distribution of orders by their customer’s last ordered date.

Loading...