Overview: Mixpanel Query Builder

In this article, we will explain elements and functionality of the Query Builder for Mixpanel through an example. Our example will be based on "Segmentation", however you can also choose "Explore, Funnels, Retention and Multisegmentation".


Custom Query Name: Write a name for your custom query in this field. You will find this name/title as a metric option in the designer after saving the query.
We chose "New queries / basic from US" for our query name.

1. Segmentation

Our goal is to figure out how many new queries (in the Databox web application) were created - only for users on a basic plan and from the United States.

 Event (required): Select a metric from your connected google analytics data source (the aggregated statistics for user activity to your site), such as users, new users, clicks or page views. A metric can be used in combination with other dimensions or metrics, but only where valid combinations apply for that metric. 
  Filter (optional): The  dimensions parameter breaks down metrics by common criteria, such as by  browser or  country (like in our example). When dimensions are requested, values are segmented by dimension value. If a query has no  dimensions parameter, the returned metrics will provide aggregate values for the requested date range, such as overall pageviews or total bounces.
  Date Range (required): To display your data the way you like, you will need to choose a date range (Today, Last 7 Days,..). Just click on the "Date range" field and select the intervals, which will be enabled for the new metric.

Compare With (optional): Select a date range to compare your previously selected interval to. This date range will be used for "previous line" on line and bar charts, and for calculating change %. Options are:  None and Previous period .

  Here you can choose how to display your data:
Unit (optional): This determines the buckets into which the property values that you segment on are placed.
Type (optional): If this is set to "unique", we return the unique count of events of property values. If set to "general", we return the total, including repeats. If set to "average", we return the average count.

2. Advanced options

Here you can choose, how the results should be displayed:

  • Push timestamp instead of value - If checked, values will be replaced with timestamps.
  • Don't skip 0 values for dimensions - By default 0 values are skipped, since they do not contain any data. You can check this if you would like to display 0 values in the results.

3. Data preview

In Data Preview you will see all values for the selected metric and date ranges. At the bottom you can check total values. Just click on tabs for switching between date ranges, if you have selected more than one.

If you want to sort values by date/time just click on the arrow next to "Date"

When your query is ready, click "Save query." Now a new metric has been created, with the metric name the same as the custom query name.

By default, a metric will be added in the datasource where data is pulled. It is possible to change the target datasource by clicking on "Change target data source" on the top right.


Rename Dimension:

It is possible to rename dimensions (best practice is to rename them before saving the query) by clicking  "..." next to "Dimension" and then selecting "Rename dimension".

Skip Dimension:

This function is useful when you want to exclude one or more dimensions (for example if you want to show data for all Countries except one). Click on  "..." next to "Dimension" and select "Skip dimension".

Round values:

Click on  "..." next to "Value" and select "Round values." Enter the number of decimal places to be rounded to into field in popup, and values will be rounded accordingly.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us