Add a conditional column

With QuickTable, you can create new columns whose values will be based on one or more conditions applied to other columns in your dataset.

You can find it in New column:

In this example, you'll be using the dataset shown in the following image.

In this table, you want to group consumers by Sales and Product Category. You will create a new column: Customer Group.

  • When the Product Category is "Office Supplies" and the Sales are less than 100 , the Customer Group is 1, otherwise the Customer Group is 2;

  • When the Product Category is "Technology" and the Sales are less than 50 , the Customer Group is 3, otherwise the Customer Group is 4;

  • Otherwise the Customer Group is 5;

To add this conditional column, select New column > By conditions. In the configuration panel, you will define New column name, conditional rules, and what unmatched content will be classified as.

  1. Enter the new column name: Customer Group.

  2. Insert category name: 1.

  3. Edit conditions as follows:

Next, this dialog will open, just check "Technology":

Click Save, and click + Add column:

Select Sales and choose "Less than", enter 100:

Click Save, you will get this:

Click Save again, and you're done with a configuration.

You can click +Add classification to continue configuring more options.

Ultimately, you should have the following configuration:

Click the "Save" button, you will get your expected result.

Last updated