# 11.4 Data Preparation in Customer Journey Analytics

## Objectives

* Understand the Analysis Workspace UI in CJA
* Understand the concepts of data preparation in Analysis Workspace
* Learn how to do data calculations

## 11.4.1 Analysis Workspace UI in CJA

Analysis Workspace removes all of the typical limitations of a single Analytics report. It provides a robust, flexible canvas for building custom analysis projects. Drag-and-drop any number of data tables, visualizations, and components (dimensions, Metrics, segments, and time granularities) to a project. Instantly create breakdowns and segments, create cohorts for analysis, create alerts, compare segments, do flow and fallout analysis, and curate and schedule reports for sharing with anyone in your business.

Customer Journey Analytics brings this solution on top of Platform data. We highly recommend watching this four-minute overview video:

> [![CJA OVERVIEW VIDEO](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-0379cd30dc909099504d8fca1281e28e7ddb27a5%2Fcja-overview-video-thumbnail.png?alt=media)](https://video.tv.adobe.com/v/35109?quality=12\&learn=on)

If you haven't used Analysis Workspace before, we highly recommend watching this video:

> [![ANALYSIS WORKSPACE VIDEO](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-284e02eca9e134c9c8e564afba9e17f7c523b7a1%2Fanalysis-workspace-video-thumbnail.png?alt=media)](https://video.tv.adobe.com/v/26266?quality=12\&learn=on)

### Create Your Project

Now it's time to create your first CJA project. Go to the projects tab inside of CJA. Click **Create new**.

![demo](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-4cf7bf6e9f83c49dd4872a75f0d69ebda815e3b0%2Fprmenu.png?alt=media)

You'll then see this. Select **Blank project** and then click **Create**.

![demo](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-5ec7b296b2e29fefadc718230f119469c35035e9%2Fprmenu1.png?alt=media)

You'll then see an empty project.

![demo](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-44ffc10978e64c38fea35901d35253cfb9b55088%2Fpremptyprojects.png?alt=media)

First, make sure to select the correct Data View in the upper right corner of your screen. In this example, the Data View to select is `vangeluwe - Omnichannel Data View`.

![demo](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-832167d483e8b6831bf9c6c2a5541129cc499528%2Fprdv.png?alt=media)

Next, you'll save your project and give it a name. You can use the following command to save:

| OS      | Short cut   |
| ------- | ----------- |
| Windows | Control + S |
| Mac     | Command + S |

You'll see this popup:

![demo](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-42c6a943ddb1549505ba756f2983f034947eaa91%2Fprsave.png?alt=media)

Please use this naming convention:

| Name                                         | Description                                  |
| -------------------------------------------- | -------------------------------------------- |
| `--demoProfileLdap-- - Omnichannel Analysis` | `--demoProfileLdap-- - Omnichannel Analysis` |

Next, click **Save**.

![demo](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-a664acfeab586b25d017e7ebfc630c55ebb992a1%2Fprsave2.png?alt=media)

## 11.4.2 Calculated Metrics

Although we have organized all the components in the Data View, you still need to adapt some of them, so that business users are ready to start their analysis. Also, during any analysis you can create calculated metric to go deeper on the insights finding.

As an example we will create a calculated **Conversion Rate** using the **Purchases** metric/event we defined on the Data View.

### Conversion Rate

Let's start opening the calculated metric builder. Click on the **+** to create your first Calculated Metric in Analysis Workspace.

![demo](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-770ebd6f739f9c4b88edab23a48419e30d4012f3%2Fpradd.png?alt=media)

The **Calculated Metric Builder** will show up:

![demo](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-d047f0e2d74111eec292df011316410bfd6aceac%2Fprbuilder.png?alt=media)

Find the **Purchases** in the list of Metrics in the left side menu. Under **Metrics** click **Show all**

![demo](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-6fc80edc24d3f372eb97edb474b1eed29b392248%2Fcalcbuildercr1.png?alt=media)

Now drag an drop the **Purchases** metric in to the calculated metric definition.

![demo](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-410cd5ae60640f29d34b0c6818a040457f4a5cf6%2Fcalcbuildercr2.png?alt=media)

Typically, conversion rate means **Conversions / Sessions**. So let's do the same calculation in the calculated Metric definition canvas. Find the **Sessions** metric and drag and drop it into the definition builder, under the **Purchases** event.

![demo](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-2bd5d23a87a0dbd0fccb5b35116fa1c1ae2a151e%2Fcalcbuildercr3.png?alt=media)

Notice that the division operator is automatically selected.

![demo](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-d42ba5e7a031d245fcff089f3dcb010afb456cc9%2Fcalcbuildercr4.png?alt=media)

The conversion rate is commonly represented in percentage. So, let's change the format to be percentage and also select 2 decimals.

![demo](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-05d1e08b4202d44fd51ff4d9885535485b403fdf%2Fcalcbuildercr5.png?alt=media)

Finally, Change the name and description of the calculated metric:

| Title           | Description     |
| --------------- | --------------- |
| Conversion Rate | Conversion Rate |

You will have something like this on your screen:

![demo](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-69ec09b5524460e8f5d59c832f34ee3c7263f8a2%2Fcalcbuildercr6.png?alt=media)

Don't forget to **Save** the Calculated Metric.

![demo](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-56eedbe292b7592dc092a8a7a3f9503c24ad469c%2Fpr9.png?alt=media)

## 11.4.3 Calculated Dimensions: Filters (segmentation) & Date Ranges

### Filters: Calculated Dimensions

Calculations are not meant to be only for Metrics. Before starting any analysis it's also interesting to create some **Calculated Dimensions**. This basically meant **segments** back in Adobe Analytics. In Customer Journey Analytics, these segments are called **Filters**.

![demo](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-b94c68b2a0ef8655f932736da1f6791b015a1692%2Fprfilters.png?alt=media)

Creating filters will help business users to start the analysis with some valuable calculated dimensions. This will automate some tasks as well as helping on the adoption part. Here are some examples:

1. Own Media, Paid Media,
2. New vs Returning visits
3. Customers with Abandoned Cart

These filters can be created before or during the analysis part (which you'll do in the next exercise).

### Date Ranges: Calculated Time Dimensions

Time Dimensions are another type of calculated dimensions. Some are already create, but you also have the ability to create your own custom Time Dimensions at the data preparation phase.

These Calculated Time Dimensions we will help analysts and business users to remember important dates and use them to filter and change the reporting time. Typical questions and doubts that come to our minds when we do analysis:

* When was Black Friday last year? 21th-29th?
* When did we run that TV campaign in December?
* From when to when did we do the 2018 Summer Sales? I want to compare it against 2019. By the way, do you know the exact days in 2019?

![demo](https://858372621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpBC8bA57il8Sj47B7QPJ%2Fuploads%2Fgit-blob-114337a6fa7cd6e1d4cc27b1063263f4aac62c2a%2Ftimedimensions.png?alt=media)

You've now finished the data preparation exercise using CJA Analysis Workspace.


---

# Agent Instructions: 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:

```
GET https://docs.adobesandbox.com/comprehensive-technical-tutorial-archive/module11/ex4.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
