## Overview

Segmenting your contacts based on how one attribute compares to another helps you target more precisely—such as identifying contacts whose _last purchase date_ is earlier than their _signup date_, or where _total spent_ is greater than _average order value_.

This article walks you through how to set up these comparisons.

Use contact attribute comparisons when you want to:

- Find discrepancies in data (e.g., last login before signup)
- Target users with high engagement or spending
- Create dynamic audiences based on user behavior

Make sure:

- Both attributes exist and are the **same data type** (e.g., both dates or both numbers)
- The comparsion only works for contact attributes of type date, number and string with cardinality one i.e. string attributes which can have one value not many.

## How to Create a Segment by Comparing Attributes

Follow these steps to create a segment by comparing attributes

- Navigate to the Audience > Lists & Segments section in the Marketing menu and click **“Create > Segment”**.
- Start by selecting the **Properties of Contact** filter.
- Select a date, number or string attribute
- Select the operator under the section **Compare attribute**
- Select another attribute of the same type to compare the two and get the segment results
- You will find different options based on type of attribute
  - **Date comparison**: When selecting a date attribute, you will get the options as:
    - is after: Selected date value falls after the other date attribute
    - is before: Selected date value falls before the other date attribute
    - is on: Selected date value falls on same date as the other date attribute
    - is not on: Selected date value doesn't fall on same date as the other date attribute  
      e.g. `Last purchase date is after Signup date`

  ![Date attribute operator dropdown with Compare attribute options is after, is before, is on, is not on](https://framerusercontent.com/images/dupMIoukQXfbsqBY7z4WG5huAA.png)
  - **Number comparison**: When selecting a number attribute, you will get the options as:
    - is greater than: Selected number value is greater than the other number attribute
    - is less than: Selected number value is less than the other number attribute
    - equals: Selected number value is same as the other number attribute
    - not equals: Selected number value is not same as the other number attribute  
      e.g.`Total spent is greater than Average order value`

  ![Number attribute Compare attribute options equals, not equals, is greater than, is less than](https://framerusercontent.com/images/LeNTNzSFxhh3qc4TC9gqf9DrTVM.png)
  - **Text comparison**: When selecting a string attribute, you will get the options as:
    - equals: Selected string value is same as the other string attribute
    - not equals: Selected string value is not same as the other string attribute  
      e.g. `Preferred language not equals Last used language`