Metabase funnel chart7/22/2023 category FROM people JOIN orders ON people. The table would look something like this: Let’s say we have a customer pool of one hundred customers who placed orders. For the next step, we’re going to winnow that population down to only those who placed orders in at least two product categories, then three categories, then four. We’re going to take all the customers who placed an order for any category as step one. So for this example, we want to see how our customers break out based on how many different categories of products they’ve ordered.Ī crucial distinction to make here is that we’re not trying to see the distribution of customers, i.e., we’re not trying to see if how many customers ordered from just one product category, how many order from two categories, and so on. Funnel chart example using SQLĪnother contrived example using the Sample Database: let’s say we learn that customers with the highest lifetime value are those that place orders from all four of our product categories: Doohickeys, Gadgets, Gizmos, and Widgets. Here’s the custom expression used in figure 4: case( = "Widget", 1, = "Gadget", 2, = "Gizmo", 3, = "Doohickey", 4)īasically, we’re saying Widgets are step 1 of the funnel, Gadgets are step 2, and so on. ![]() Creating a custom column using a custom expression to specify the order of steps in the funnel. Using the above query as an example, we could modify it to preserve the sequence by adding another column, step, and then sorting by step. In these cases, you can create an additional column to number the steps, and sort by step to enforce the correct funnel sequence. Likewise if you have funnels that can expand in count at certain steps (new people entering the funnel halfway through, for example) the funnel will default to descending counts, which will mess up your step order. For example, if you have the same count in successive steps, the steps could get swapped in the funnel chart, like if Metabase defaults to sorting the steps alphabetically to break the tie. If the count in each step doesn’t naturally decrease, you may need to sort the steps manually to preserve the actual progression of steps. Keeping the steps sorted with a custom column The advantage of a funnel chart (beyond the visual metaphor) is that Metabase will also show the percentage of the measure that made it through each step. Notice that in the Settings -> Display tab, you can change the Funnel type to “Bar chart”, which is another valid way of representing the data. A (rather chubby) funnel chart that uses categories as steps in the funnel. In the settings of a funnel chart, under the Data tab, you can set the Step (in this case we’re using the product category) and the Measure (the count of orders). To get a funnel chart, we clicked on Visualization in the bottom left, and selected Funnel. Then we’ve sorted the results by count, descending. What we’ve done is joined the Orders and Products tables (see Joins in Metabase), summarized the count of orders, and grouped those counts by product category. The notebook view of the query for our funnel chart. Here’s the notebook view of our query: Fig. We’re going to pretend that the steps in our funnel are product categories (because we don’t have anything like statuses or pages or other progressions in our Sample Database). Funnel chart example using the query builder ![]() So we’ll have to get a little creative here to come up with examples for funnel charts. The Sample Database doesn’t contain events it’s just four tables with order, product, and customer information. We’ll show examples both in the query builder and the sql editor: We’ll walk through how to build a funnel chart in Metabase using the Sample Database included with your installation so you can follow along. Then how many people viewed a product page (step 2), how many added that item to their cart (step 3), and so on. The first step (or gate) would be how many people visited your site. Typically they’re used to show how many people make it through a particular sequence, such as a checkout flow on a website. One of the funnel charts we'll build with the Sample Database.įunnel charts visualize how a measure breaks out across a series of steps.
0 Comments
Leave a Reply. |