Skip to main content

Find a billable metric

Prerequisites

  • You need a role with the Can Read Billable Metric permission.

Steps

  1. Go to Usage > Billable Metrics. The list shows the billable metrics of your organization.
  2. Optional: To narrow the list, click FILTER. In Filter by…, select Name or Created At. Select a condition and a value, and click APPLY FILTER. The list shows only the billable metrics that match. To remove all filters, click Clear All Filters.
  3. Optional: To sort the list, click a column header. Click it again to sort in descending order, and a third time to remove the sorting.
  4. In Search Billable Metric, enter part of the name, and select the billable metric from the results. You can also click the billable metric in the list.
The billable metric opens in the editor. See Billable Metrics screen: controls, columns, and filters.

Create a billable metric

Prerequisites

Steps

  1. Go to Usage > Billable Metrics.
  2. Click ADD NEW BILLABLE METRIC. The Add New Billable Metric screen opens with VISUAL BUILDER selected.
  3. Choose the builder: You can start in the visual builder and move to the SQL builder later. You cannot move back. See Move a billable metric to the SQL builder.
  4. Build the billable metric in the builder that you chose:
    1. Under Select tables & filters, in Table Name, select the table. Usage-event collections are listed under Usage Event by their API slug. Tables of synced usage data are listed under Data source.
    2. Optional: Click + ADD FILTER. Select a Column and a Condition, and enter a Value. Repeat for each filter. To remove a filter, click its delete icon.
    3. Optional: To add a group of filters, click + NEW FILTER GROUP. To switch between AND and OR, click the AND or OR button between the filters or the groups. To remove every group except the first, click CLEAR ALL FILTER GROUPS.
    4. Click NEXT.
    5. Under Map customer, in Your customer column, select the column that identifies the customer. In Zenskar customer column, select email, external_id, customer name, or Custom attribute: <name>. A custom attribute shows only when it belongs to customers and has the custom attribute type Text, Whole number, or Dropdown.
    6. Click NEXT.
    7. Under Set date field, in Column, select the column that dates each row. If it is not timestamp, select its Date Format.
    8. Click NEXT.
    9. Under Set Billable Metric over, in Select calculation type, select the calculation type. In Select column to calculate over, select the column.
  5. Optional: Check the result. See Preview a billable metric.
  6. Click CREATE BILLABLE METRIC. The Choose Billable Metric Name window opens. CREATE BILLABLE METRIC is available on the last step of the visual builder, or in the SQL builder after you click EDIT and confirm.
  7. Enter the name.
  8. Click CREATE BILLABLE METRIC.
Zenskar saves the billable metric. The Billable Metrics list opens. See Billable metric editor: builders, fields, and preview.

Preview a billable metric

Run a billable metric for a customer and a period before you save it.

Prerequisites

  • You need a role with the Can Read Billable Metric permission.

Steps

  1. Open the billable metric in the editor, or build a new one. See Create a billable metric.
  2. Under Query preview, in Search By Customer Name, External ID, select the customer. In the visual builder, the field is available from Map customer on.
  3. In the SQL builder, if the query uses a contract or product variable, select the contract in Contract or the product in Product.
  4. In Billing Period, select the first and last days of the period. In the visual builder, the field is available from Set date field on.
  5. Click RUN QUERY. In the SQL editor, you can also press Ctrl+Enter, or Cmd+Enter on a Mac. The preview runs only when each variable that the query uses has a value, and Billing Period has both dates.
The table under Query preview shows the result. When the query has an error, the table area shows the error. To download the result as a CSV file, click Export Results. See Query preview.

Edit a billable metric

Prerequisites

  • You need a role with the Can Update Billable Metric and Can Read Billable Metric permissions.

Steps

A change to a billable metric applies to every pricing preset that uses it. It can affect contracts and invoices. Check which pricing presets use the billable metric before you save.
  1. Go to Usage > Billable Metrics.
  2. Click the billable metric. You can also open its actions menu and click Edit. The billable metric opens in the editor, with its name as the title.
  3. Change the billable metric in the builder that it uses:
    • A billable metric from the visual builder opens at Set Billable Metric over. To change an earlier step, click BACK.
    • A billable metric from the SQL builder opens with the query ready to edit.
  4. Optional: Check the result. See Preview a billable metric.
  5. Click SAVE CHANGES.
Zenskar saves the billable metric. The editor stays open. See Billable metric editor: builders, fields, and preview.

Move a billable metric to the SQL builder

Move a billable metric from the visual builder to the SQL builder, for example to add a dimension or a condition that the visual builder does not cover.

Prerequisites

  • You need a role with the Can Update Billable Metric and Can Read Billable Metric permissions.

Steps

After you save, the billable metric cannot return to the visual builder. Preview the converted query before you save.
  1. Open the billable metric in the editor. See Edit a billable metric.
  2. Click SQL BUILDER. Zenskar converts the settings of the visual builder into a query. The editor shows the converted query, read-only.
  3. Click EDIT. In SQL Builder Edit Access, click YES.
  4. Optional: Change the query.
  5. Preview the billable metric. See Preview a billable metric.
  6. Click SAVE CHANGES.
Zenskar saves the billable metric as a query. VISUAL BUILDER is no longer available for it. To keep the visual builder, leave the editor before you save. See SQL builder.

Rename a billable metric

Prerequisites

  • You need a role with the Can Update Billable Metric and Can Read Billable Metric permissions.

Steps

  1. Open the billable metric in the editor. See Edit a billable metric.
  2. Next to the name in the title, click the pencil icon. The Update Billable Metric Name window opens.
  3. Enter the new name.
  4. Click UPDATE.
Zenskar saves the new name right away, without SAVE CHANGES. The calculation does not change.

Delete a billable metric

Prerequisites

  • You need a role with the Can Delete Billable Metric and Can Read Billable Metric permissions.

Steps

You cannot restore a deleted billable metric. Zenskar deletes it even when a pricing preset uses it, which can affect contracts and invoices. Check which pricing presets use it before you delete it.
  1. Go to Usage > Billable Metrics.
  2. Open the actions menu of the billable metric, and click Delete.
  3. In Delete Billable Metric, click DELETE.
Zenskar deletes the billable metric. The billable metric disappears from the list.