LogoLogo
HomeDocumentation
  • 🐳Using Whaly Guides
  • Core concepts
    • 📚Getting started
      • Data stack architecture
      • Consumers vs Builders
      • Data layers in Whaly
      • License Mapping
    • 🪄Data modeling
      • Understanding data models
      • Designing data models
      • Common modeling patterns
        • Event schema
      • Maintaining data models
      • Data models best practices
    • 🖌️Explorations
      • Understanding Explorations
      • Designing Explorations
      • Maintaining Explorations
      • Mistakes to avoid
  • Training
    • 👁️For viewers
    • 👩‍💻For editors
    • 🧙For builders
      • Setting up the training material
      • Creating a chart
      • Using and editing explorations
      • Filtering a dashboard
      • Creating explorations and models
  • Inspiration
    • 🗒️Use cases
      • Billing / Invoicing
      • Customer success
      • Fundraising
      • Marketing
      • Partnerships
      • Product
      • Sales
      • Strategy
    • 💬Communication
    • 💡Tips
  • Recipes
    • 🤝Customer care
      • How to build a 360° customer dashboard
    • 🏦Finance
      • Modeling your recurring revenue
        • SQL for simplified MRR calculation
        • SQL for advanced MRR calculation
    • 📣Marketing
      • Track your entire Marketing Funnel
      • Calculate your Customer Acquisition Cost
      • Create a partner dashboard
    • 💼Sales
      • Analyze the impact of your Sales velocity on your closing rate
      • Create a sales performance dashboard
      • Build a target oriented sales dashboard
  • Misc
    • 🧐SQL Fanout
    • 📦Backup your data using BigQuery
    • ☁️Embedding reports in Salesforce
    • 👨‍💻Useful SQL operations
      • Flattening categories
Powered by GitBook
On this page
  • Filtering a query
  • Creating a filtered metric
  • Creating a calculated metric
  • Formatting our chart
  1. Training
  2. For builders

Using and editing explorations

PreviousCreating a chartNextFiltering a dashboard

Last updated 2 years ago

Objectives: in this exercise we will learn how to filter a query, create a metric, create a calculated metric and use the chart formatting options. In this article we will learn about:

Filtering a query

In this exercice we want to :

Add the amount of payment paid with Gift cards per month

Start by duplicating the initial tile from the training dashboard, then:

  1. Replace the measure "Number of orders" with "Total payment amount"

  2. Add a filter on the query editor: Payment method equals gift card

Great, now we can see the amount paid each week by gift card. However, having a filter at the chart level is not optimal as it does not allow other users to easily re-use this metric.

Creating a filtered metric

We will create a new metric corresponding to the payments with gift card:

  1. Edit your exploration by clicking on "Edit in workbench"

  2. Create a new metric under the payment table

    1. The metric should be a sum of the column "amount"

    2. Filter on payment method gift_card

    3. Give your metric a name: Payments with gift card

    4. Set the metric type as number, and add $ as a suffix

Now we can add our new metric to our chart and run the query. We can see that the two measures are displayed, but are equals.

This is because we still have the filter at the chart level. Let's remove it and run the query again: now we can see both the total payment amount and the total payment amount by gift card side by side.

Creating a calculated metric

Now imagine we want to add the percentage of payment made by gift card on our chart. To do so :

  1. go to the exploration edition page in the workbench

  2. click on the + sign next to Payment in the left side panel

  3. click on Add a calculated metric

  4. In the formula editor, type :

Payments with gift card / Total payment amount

Give your metric a name, for example : %age of payment amount with gift card, and set the type as percentage in the advanced settings. Save your metric. Now add this metric to the chart and click on run query.

The metric is added to our chart, but is too small to be visible. In order to fix, we will need to edit our chart options.

Formatting our chart

In the right panel:

  1. Toggle "labels" to display labels

  2. Enable the right axis

  3. Assign the % of gift card payment to this right axis, and change it's type to Area

🧙