> For the complete documentation index, see [llms.txt](https://docs.antsomi.com/cdp-365-user-guide-en/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.antsomi.com/cdp-365-user-guide-en/use-cases/personas/visitors-customers/how-to-create-a-customer-computed-last-attribute.md).

# How to create a Customer Computed-Last Attribute

## Use case:

You want to create an attribute that **returns the name of the product visited by a customer  - Last viewed product**

## Steps:

You can follow these steps below in order to create a Customer Computed Attribute:

1. Hover your mouse over **Data** (on the left hand side menu), then click **Data Object** and select **Customer**

<figure><img src="https://826840553-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbtU4vFUxT5JkWYHePuoX%2Fuploads%2FYOq5Qx02sbynnfYCL2jV%2Fimage.png?alt=media&amp;token=7465b2f3-cbdd-47c0-8f3a-515e229adb99" alt=""><figcaption></figcaption></figure>

2\. Select **Attributes** on the left hand side, click **+** button, and then select **Create new Attribute**

<figure><img src="https://826840553-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbtU4vFUxT5JkWYHePuoX%2Fuploads%2FrRiY6er3JnfVVkXU2g2d%2Fimage.png?alt=media&amp;token=74887e8c-98a5-4929-af66-0498f501f32c" alt=""><figcaption></figcaption></figure>

<figure><img src="https://826840553-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbtU4vFUxT5JkWYHePuoX%2Fuploads%2FhM5js1TwEco15o9Ryas3%2Fimage.png?alt=media&amp;token=932ada89-a5c1-4b2f-882f-0a094bea557f" alt=""><figcaption></figcaption></figure>

3\. At the Create a new attribute interface, choose **Last - Computed Attribute Types**

<figure><img src="https://826840553-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbtU4vFUxT5JkWYHePuoX%2Fuploads%2FnIb2mHQq7i2NEUg7KLGF%2Fimage.png?alt=media&amp;token=ec6e1c41-8718-4361-b41d-c3807a501d64" alt=""><figcaption></figcaption></figure>

4\. **Configure computed attribute - Last viewed product**:&#x20;

* **General information**:&#x20;
  * Group attribute: Web Analytics History
  * Attribute name: Last viewed Product&#x20;
  * Attribute internal code: last\_viewe&#x64;*\_*&#x70;roduct
  * Description: The product that the customer viewed the last time

<figure><img src="https://826840553-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbtU4vFUxT5JkWYHePuoX%2Fuploads%2Frv27te5fri0mUU6jzLIu%2Fimage.png?alt=media&amp;token=38525042-a83f-4095-9831-d6ce9dc3feef" alt=""><figcaption></figcaption></figure>

* **Setting:**
  * Time range: All time
  * Events: View product
  * Sources: Websites
  * Event attribute: Product >> Name
  * Display format: Raw string

<figure><img src="https://826840553-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbtU4vFUxT5JkWYHePuoX%2Fuploads%2F4CZ5EIJfP9xqZdCSNmd6%2Fimage.png?alt=media&amp;token=efb886ab-afd7-439a-ad0a-006e6834cacb" alt=""><figcaption></figcaption></figure>

* **Computation schedule:**
  * Repeat by: Day, at 3:00 AM
  * Repeat every: 1 day
  * Start time: 06/10/2022
  * End time: On 13/10/2022 at 02:00 AM

<figure><img src="https://826840553-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbtU4vFUxT5JkWYHePuoX%2Fuploads%2FLxeRnQgdBoIQR4dzaZa7%2Fimage.png?alt=media&amp;token=72628c50-6876-466f-9ccd-7e3c4dc4d97f" alt=""><figcaption></figcaption></figure>

* **Notification Setup**: Notify when the computation fails by sending an Email and pushing a notification

<figure><img src="https://826840553-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbtU4vFUxT5JkWYHePuoX%2Fuploads%2FVwNEgCeiEPYw5yzRo64t%2Fimage.png?alt=media&amp;token=b210f1f3-5afb-405d-b508-c7fd9a44f213" alt=""><figcaption></figcaption></figure>

5\. Click ![](https://826840553-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbtU4vFUxT5JkWYHePuoX%2Fuploads%2FZY2TgVBuZyDfzBFM5LDF%2Fimage.png?alt=media\&token=1d9a78c3-391d-4afa-9a57-650aef4dd063)

## The result of the attribute

### Process status

You can find the process status, size, and more information about the **Last viewed Product** in the **Attribute Data table**&#x20;

<figure><img src="https://826840553-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbtU4vFUxT5JkWYHePuoX%2Fuploads%2FNiBK463q1dGajoMBVTMo%2Fimage.png?alt=media&amp;token=df57edc8-3e50-40b4-85a3-e83469f41ed1" alt=""><figcaption></figcaption></figure>

<figure><img src="https://826840553-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbtU4vFUxT5JkWYHePuoX%2Fuploads%2FOI7roJPesDcn9WFcqrn5%2Fimage.png?alt=media&amp;token=e5764f4e-e5c6-4e55-9afe-0257ec4e9fe7" alt=""><figcaption></figcaption></figure>

### The returned value corresponding result of the computed attribute

You can find the value **Last viewed Product of each customer** in the **Customer Data table**

<figure><img src="https://826840553-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbtU4vFUxT5JkWYHePuoX%2Fuploads%2FeDjEue8GSUvfSyzynSFe%2Fimage.png?alt=media&amp;token=f4ace391-7aaa-43e9-be74-4ae40b67591e" alt=""><figcaption></figcaption></figure>

{% embed url="<https://drive.google.com/file/d/1oAsA86DkPMySRXGsuZtqIPmVSllE48GX/view?usp=sharing>" %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.antsomi.com/cdp-365-user-guide-en/use-cases/personas/visitors-customers/how-to-create-a-customer-computed-last-attribute.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
