Skip to main content

Find a billable metric

Find a billable metric in the Billable Metrics list by name. You can also narrow the list with filters and sorting.

Prerequisites

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

Search for a billable metric by name

  1. Go to Usage > Billable Metrics.
  2. In Search Billable Metric, enter part of the name.
  3. Select the billable metric from the results.
The billable metric opens in the editor.

Filter the list

  1. Go to Usage > Billable Metrics.
  2. Click FILTER.
  3. In Filter by…, select Name or Created At.
  4. Select a condition and a value.
  5. Click APPLY FILTER.
The list shows only the billable metrics that match. To remove all filters, click Clear All Filters.

Sort the list

  1. Go to Usage > Billable Metrics.
  2. Click a column header. The list sorts by that column in ascending order.
  3. Click the column header again to sort in descending order.
  4. Click the column header a third time to remove the sorting.

Create a billable metric

Create a billable metric with one of two builders. Both builders save the same kind of billable metric. Both end with the same naming step. 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.

Prerequisites

Open a new billable metric

  1. Go to Usage > Billable Metrics.
  2. Click ADD NEW BILLABLE METRIC. The Add New Billable Metric screen opens with VISUAL BUILDER selected.

Build the billable metric

  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 data 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.

Name and save the billable metric

  1. Optional: Check the result. See Preview a billable metric.
  2. Click CREATE BILLABLE METRIC. The Choose Billable Metric Name window opens.
  3. Enter the name.
  4. Click CREATE BILLABLE METRIC.
Zenskar saves the billable metric. The Billable Metrics list opens.

Fix a failed save

  • CREATE BILLABLE METRIC stays unavailable in the visual builder until you reach Set Billable Metric over. In the SQL builder, it stays unavailable until you click EDIT and confirm.
  • NEXT does not move on when the table has no columns or a filter is incomplete. Choose another table, or complete the filter.
  • Zenskar rejects a query whose Zenskar SQL variables are not valid. Correct the variables.

Preview a billable metric

Run a billable metric for a customer and a period before you save it. Check the number that it gives.

Prerequisites

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

Run the preview

  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 table under Query preview shows the result. To download it as a CSV file, click Export Results.

Fix a failed preview

  • In the SQL builder, Zenskar does not run the preview when the query uses a variable that has no value. Select the customer, the contract, the product, or the dates that the query uses.
  • In the visual builder, Zenskar does not run the preview without both dates of Billing Period. Select both dates.
  • When the query has an error, the table area shows the error. Correct the query. Run it again.

Edit a billable metric

Change how a billable metric reads and calculates usage. A change applies to every pricing preset that uses the billable metric. Changing a billable metric can affect contracts and invoices.

Prerequisites

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

Change the billable metric

  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.

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. Zenskar converts the settings of the visual builder into a query.

Prerequisites

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

Move the billable metric

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. 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.

Rename a billable metric

Change the name of a billable metric. The calculation does not change.

Prerequisites

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

Change the name

  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.

Delete a billable metric

Delete a billable metric that you no longer need. Zenskar deletes it even when a pricing preset uses it.

Prerequisites

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

Delete the billable metric

You cannot restore a deleted billable metric. Deleting a billable metric that a pricing preset uses 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. Click Delete.
  3. In Delete Billable Metric, click DELETE.
Zenskar deletes the billable metric. The billable metric disappears from the list.