# Row by row metrics

After you [finish **Step 1 (Metric Info)**](..#step-1-metric-info), **Step 2 (Configure Metric)** appears in the main form:

<figure><img src="https://3772145110-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7hLPjNTyFMw1VTOP6ZnD%2Fuploads%2FmM0O6cltw3dGPjmErFcM%2Fnew-rXr-custom-metric.png?alt=media&#x26;token=efbddcc7-d7e1-43c2-83ea-dbd1fa2b71c4" alt="Step 2 (Configure Metric) of metric configuration for a custom &#x22;Row by row comapre&#x22; metric"><figcaption></figcaption></figure>

1. Under **Source**, select a datasource, a schema, and a table. Do the same under **Target**. These are the tables the metric will compare.
2.  Optionally, to create a WHERE clause select **Add +** below either table. New fields then appear under **Where clause** that you can use to specify the necessary condition. To delete a WHERE clause, use the waste bin icon beside it to the right. \
    \


    <figure><img src="https://3772145110-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7hLPjNTyFMw1VTOP6ZnD%2Fuploads%2FNtn86ZrIhmWEc43KFTrS%2Fdel-rXr-whereclause.png?alt=media&#x26;token=54950152-4244-47e1-ae1b-5436412a9245" alt="Annotated image of WHERE clauses in a custom row by row compare metric"><figcaption></figcaption></figure>
3. On the right margin beside **Key columns to compare**, select **Add**, then choose the column to match from each table. You may add more than one pair.&#x20;
4. Optionally, on the right margin beside **Attribute columns to compare**, select **Add**, then choose the columns to compare from each table. You may add more than one pair.
5. Under **Configure metric**, select the timestamp column for each data asset, and the aggregation interval and aggregation time zone for the metric's query. Also enter a number and choose a period to specify the **Evaluation delay**.&#x20;
6. To improve query performance, select slice columns for both tables.
7. When you're ready, select **Next** at the top right corner to proceed to **Step 3 (Preview)**.

### Step 3 (Preview)

<figure><img src="https://3772145110-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7hLPjNTyFMw1VTOP6ZnD%2Fuploads%2FbRdsCNXTpJzWnQGUK0oI%2Fpreview-rXr.png?alt=media&#x26;token=00dca4ef-16be-4763-aa04-fe124bde0508" alt="Annotated image of Step 3 (Preview), of a custom row by row metric configuration"><figcaption></figcaption></figure>

1. Select **View sample data** to see a sample set of rows from the data asset. Lightup returns 100 rows of data from the source table, including metadata. Select **Stop Viewing** when you're done.&#x20;
2. Optionally, adjust the date range for the preview. If you adjust the range, you must pick a start date and an end date.
3. Select **Preview** to see a chart of the metric for the date range from the preceding step.

After you're satisfied with the preview, select **Create** at the top right corner. The Explorer tab opens and displays your new metric in the Explorer tree.
