Skip to main content

5 posts tagged with "Metrics"

· One min read

Business Metrics are based on aggregate data analysis. In some cases, you want to sum revenue for example. In other cases, you want to count the number of requests or count unique visitors for a given time range. In addition to Sum, Count, and Count Distinct Metric types, you can now define Min, Max and Average Metric types.

  • Min - Selects the minimum value of the specified column for every record that matches the Metric Filters. For time series, it will select the minimum value for each time granularity.
  • Max - Selects the maximum value of the specified column for every record that matches the Metric Filters. For time series, it will select the maximum value for each time granularity.
  • Average - Averages the values of the specified column for every record that matches the Metric Filters. For time series, it will average the values for each time granularity.
· 2 min read

Once a data set gets to a certain size, as engineers we often wonder, “What values do we actually have in there?” Answering this question can help us understand the correctness of our data, but it can also help us improve the product experience.

For example, if you want to filter on a numerical Dimension, wouldn’t it be great to build a slider with a min and max value? If you want to filter on a Dimension like “country,” wouldn’t it be great to build a dropdown with all the available countries in your Dimension?

Now, you can, with Dimension Statistics! When querying a Metric’s Dimensions, you can ask for stats and get the Dimension’s min, max, average, and uniqueValues:

query {
metricByName (uniqueName: "My Metric") {
dimensions {
columnName
stats {
min
max
average
uniqueValues
}
}
}
}

In fact, we’re using this feature internally in the Console to show you unique values for all of your Dimensions here:

An animated screen capture of the Propel console, showing the “View unique values” feature for a Dimension named “AREA”, powered by Dimension Statistics. A scroll-able, modal window appears, showing all the values “AREA” can take on. An animated screen capture of the Propel console, showing the “View unique values” feature for a Dimension named “AREA”, powered by Dimension Statistics. A scroll-able, modal window appears, showing all the values “AREA” can take on.

· 2 min read

In addition to counters and time series, we now support leaderboard queries. Leaderboards are great for visualizing the “top N” of something, such as “the top 10 salespeople of the month” or “the top 100 events last year.” You can query it with a timeRange set of dimensions to group on, a sort order, filters, and a lowLimit. For example,

query {
metricByName(uniqueName: "sales") {
leaderboard ({
timeRange: { relative: "THIS_MONTH" },
dimensions: [{ columnName: "SALES_PERSON" }],
rowLimit: 10
}) {
headers
rows
}
}
}

The result you get back is an array of headers and an array of rows:

{
"headers": ["SALES_PERSON", "SALES"],
"rows": [
["Alice", "100"],
["Bob", "99"],
["Carol", "80"],
["Dave", "76"],
["Erin", "75"],
["Frank", "75"],
["Grace", "66"],
["Heidi", "63"],
["Ivan", "34"],
["Judy", "33"]
]
}

Perfect for piping into your favorite graph visualization library! For example, here we use ECharts to visualize a leaderboard from the state of California:

A screenshot of a leaderboard visualization. Rows are labeled with areas from the state of California and are sorted in descending order. A screenshot of a leaderboard visualization. Rows are labeled with areas from the state of California and are sorted in descending order.

· One min read

Sometimes you need to define Metrics with a subset of the data you have. For example, if you have a Metric like revenue, you’ll want to exclude all sales records where the type is “PROMOTION” or “TRIAL”.

You can now define Metrics with a subset of records of a Data Pool. When defining a Metric via the Console or API, you can create Metric Filters to include or exclude records from the Metric values. See below for an example where we define a Metric to sum up records where “AREA” equals “California”.

An animated screen capture of the Propel console, showing how to use Metric Filters to select a subset of records from a Data Pool. An animated screen capture of the Propel console, showing how to use Metric Filters to select a subset of records from a Data Pool.

· One min read

Different products need to expose different Metrics to their end-users. For example, e-commerce products expose Sum Metrics like “Total Sales”, Count Metrics like “Number of orders”, and Count Distinct Metrics like “Unique visitors”.

When building in-product analytics, you can now define Sum, Count, or Count Distinct metrics for your product in a single place. Front-end engineers can access the Metric data with time series or counter queries using the Metrics API.

An animated screen capture of Propel’s GraphQL Explorer, showing how to query a Metric using the GraphQL API with various time granularities and filters. An animated screen capture of Propel’s GraphQL Explorer, showing how to query a Metric using the GraphQL API with various time granularities and filters.