Queries

Creating Queries & Tags for Segmenting Your Data

Learn how to create a Query to segment information about your Orders, Customers, Reservations, and Club Shipments

The Query Builder is a powerful tool that allows you to organize and categorize your data effectively. If you can't find specific information using the reporting tools, the Query Builder enables you to create custom Queries tailored to your needs. 

In this article:


Want to learn more about each Query type? Let's dive in!


QUERIES OVERVIEW / BASICS (New to Queries? Start here!)


Creating a Query

  1. Go to Marketing > Queries
  2. From the top tabs, select the type of query that you want to perform. (For this example, we will be building a Customer Query).
    1. The type of query that you select will depict the type of data that you want to find.  For example, if you query "Customers", the result will be a list of customers. If you query "Orders", the result will be a list of orders, etc.
      Screen Shot 2023-09-29 at 2.44.05 PM
  3. Once you have selected the type, click Add Customer Query at the top right.
  4. Give your query a Title and click the Add Condition Group button.
    Screen Shot 2023-09-29 at 2.49.44 PM
  5. In the popup modal, you'll set criteria for the data that you're looking for.
    1. Property Type: This is the type of information that you are going to filter based off of. For example, if you select "Order", you will be able to filter data based on the order related attributes such as the order date or total. If you select "Customer", you can filter off of customer related attributes like State or Lifetime Value. 

      What you select here will not change the type of results that you get back. In this example we are creating a "Customer" query, which means that we will always get a list of customers as our results, but we can find that list of customers based on order, club, or reservation criteria.

      Note: The "Property Type" options will also differ depending on the type of Query you are creating. For this example we are using the "Customer" Property Type.
      Screen Shot 2023-09-29 at 2.59.46 PM

    2. Return Customers: Choose whether you'd like to see results that match the conditions that you add below or do not match the conditions. 
    3. Property: Select a property from the list to start creating your conditions. This dropdown list will change depending on the "Property Type" that you selected above. In this example, we are adding a condition for "Birth Month".
    4. Condition: Choose "is equal to" or "is not equal to". You will also see different options here depending on the specific "Property" that you selected.
    5. Value: Select or enter the data for your query.
    6. Our current query will find all Customers with a Birth Month of Oct. If that's the only information that we want to find, we can click Save Condition Group and our query is complete.
      Screen Shot 2023-09-29 at 2.59.57 PM


    Add Multiple Properties/Conditions using 'OR' or 'AND' 

    • Example 1: Customers who have an October 'OR' November birthday.
    • Example 2: Customers who have an October birthday 'AND' live in California.
    1. Click "OR" beside the first condition if you want to add another condition, but the query only needs to meet at least one of the conditions.
    2. Click "AND" if you want the order query to meet all conditions you setup.
      Screen Shot 2023-10-04 at 1.48.46 PM
    3. Once you have your conditions created, click to add or Save Condition Group.

     


    Stacking Conditions

    Sometimes you need to pull data from multiple Property Types in the same Query.

    Example: Find Customers who have Oct or Nov birthdays, who have also purchased your Rose.

    • You'll use 'Customer' Property Type to find your Oct or Nov birthdays.
    • You'll use 'Order' Property Type so that you can find those who also have purchased your Rose. 
    1. Click the Add Condition Group button(Button will only appear after your query is saved for the first time.)
      Screen Shot 2023-10-04 at 1.54.25 PM
    2. For example, this time we've chosen a Property Type = 'Order'. And we only want "Customers whose Orders include the Rose SKU". 
      Screen Shot 2023-10-04 at 1.57.12 PM
      Once we save this condition group, our query will find customers who match both the the Customer conditions that we set up previously and the Order conditions that we just created.
    3. You can condition adding condition groups or editing your existing conditions, but when you're finished, click the Run Query button.

      Screen Shot 2023-10-04 at 1.58.41 PM
    4. You'll see an alert saying the query is running. (It could take a few seconds to minutes depending on how many results there are.)
    5. When it's done, you will see the results on the page. You can click any of the results to go to the Customer, Order, etc. 



    Exporting Query Results

    Once you've executed your Query at least once, you'll have the option to Export your results.

    1. Under the Actions button, choose the Export Customers option.
    2. You will be notified via email once the export is ready to download. You can also go to Settings > Bulk Actions to check status and download the CSV file.

    Tagging Query Results

    Once you've executed your Query at least once, you'll have the option to Tag your results.

    Where Can Tags be Used?

    Promotions/Coupons, Personalizations, Cart Carrots, Campaigns...and more!

    Learn all about Tags here.

    1. Under the Actions button, choose a Tagging option.



    2. Choose Tag Customers with a New Tag if you want to create a brand new tag for the Query results. (see instructions for using "Update Existing Tag" below.)
      1. Select the type of data that you want to apply the Tag to. This list will change dependent on the type of Query that you performed.
        1. For example: If you're using an Order Query, your options will be to Tag "Orders" or "Customers", if you're using a Reservation query, your options will be to tag "Reservations" or "Customers", etc.
        2. Tip: Make sure to select "Customers" if you want to use the list for any of the Marketing tools (examples: Campaigns, Personalizations, etc., or if you're building Allocation Tiers).
      2. Once you confirm a new tag will be created under Settings > Tags and the results from your query will be tagged.
    3. Choose Tag Customers & Update Existing Tag to replace the contents of an existing Tag.
      1. Select the type of Tag that you want to update and search for. This list will change dependent on the type of Query that you performed.
      2. Once you confirm, your existing Tag be updated to the results of your current Query. 
        Note: You cannot use the same tag for multiple Queries to combine results.

    Note: Tags will not dynamically update. If you want to update the Tag to be current, you'll need to first Run the Query again - and then choose to Tag Customers & Update Existing Tag.


    Customer Queries

    The Query Builder allows you to create lists of Customers based on certain criteria such as what SKUs Customers have purchased, where they live, whether or not they have a Club Membership and more.

    1. Go to Marketing > Queries
    2. For customer queries make sure that Customer is selected at the top, then click Add Customer Query at the top right

      Screen Shot 2023-10-02 at 10.19.55 AM
    3. Give your query a Title and click the Add Condition Group button.
      Screen Shot 2023-10-02 at 10.23.50 AM
    4. In the popup modal, choose the configurations for your Query.
      1. Property Type: (Note that Property Type options will differ depending on the Query type). For this example, we are using 'Customer'. 
        1. A Customer meeting the subsequent conditions you setup.
        2. A Club Membership, with the subsequent conditions you setup.
        3. An Order, with the subsequent conditions you setup.
        4. A Reservation, with the subsequent conditions you setup.
      2. Return Customers: Choose whether you'd like to see results that match the conditions or do not match the conditions. 
        Screen Shot 2023-10-02 at 10.33.26 AM
      3. Property: (Note that Property options will differ depending on the Query type): In this example, we are choosing the 'Lifetime Value' property.
      4. Condition: (Note that Condition options will differ depending on Property chosen): In this example, we are choosing 'is greater than'.
      1. Value: (Note that Value options will differ depending on the Property and Condition chosen). In this example, we are choosing '$1000'.
      2. If that is the only condition, click the Save Condition Group button.
        Screen Shot 2023-10-02 at 10.34.15 AM

    Need to add another parameter?

    Add Multiple Properties/Conditions using 'OR' or 'AND'. Learn how here.


    Stacking Conditions

    Now that your first set of conditions is complete, you can finish here and "Run Query" or you can optionally "stack" these conditions with another type of conditions - and here's how. Learn how here.


    Results

    Once you've clicked the Run Query button, you'll see an alert saying the query is running. It could take a few seconds to minutes depending on how many results there are. (You can refresh the page to see if it's still loading).

    You will see the results on the page (note that the results are clickable - they will take you to a Customer, Order, etc). You will also be emailed when the results are available for view in Commerce7.

    Once you've executed the query at least once, you can also Export or Tag your results or Customers included in these results.

    Learn more about exporting results or tagging results here.

    Need some inspiration? See commonly used example Customer Queries here.


    Order Queries

    The query builder allows you to create lists of Orders based on certain criteria such as SKU purchased, Orders by POS profile, Order history and more.

    1. Go to Marketing > Queries
    2. For customer queries make sure that Order is selected at the top, then click Add Order Query at the top right.
      Screen Shot 2023-10-02 at 11.28.39 AM
    3. Give your query a Title and click the Add Condition Group button.
      Screen Shot 2023-10-02 at 11.32.07 AM
    4. In the popup modal, choose the configurations for your Query.
      1. Property Type: (Note that Property Type options will differ depending on the Query type). For this example, we are using 'Customer'. 
        1. A Customer meeting the subsequent conditions you setup.
        2. An Order, with the subsequent conditions you setup.
      2. Return Customers: Choose whether you'd like to see results that match the conditions or do not match the conditions. 
        Screen Shot 2023-10-02 at 11.36.23 AM
      3. Property: (Note that Property options will differ depending on the Query type): In this example, we are choosing the 'Order Date' property.
      4. Condition: (Note that Condition options will differ depending on Property chosen): In this example, we are choosing 'is greater than'.
      5. Value: (Note that Condition options will differ depending on Property chosen): In this example, we are choosing 'Jan 1, 2023'.
      6.  If that is the only condition, click the Save Condition Group button.
        Screen Shot 2023-10-02 at 11.42.43 AM

    Need to add another parameter?

    Add Multiple Properties/Conditions using 'OR' or 'AND'. Learn how here.


    Stacking Conditions

    Now that your first set of conditions is complete, you can finish here and "Run Query" or you can optionally "stack" these conditions with another type of conditions - and here's how. Learn how here.


    Results

    Once you've clicked the Run Query button, you'll see an alert saying the query is running. It could take a few seconds to minutes depending on how many results there are. (You can refresh the page to see if it's still loading).

    You will see the results on the page (note that the results are clickable - they will take you to a Customer, Order, etc). You will also be emailed when the results are available for view in Commerce7.



    Once you've executed the query at least once, you can also Export or Tag your results or Customers included in these results.

    Learn more about exporting results or tagging results here.


    Club Membership Queries

    The query builder allows you to create lists of Club Members based on certain criteria such as length of time in Club, Order history and more.

    1. Go to Marketing > Queries 
    2. For customer queries make sure that Order is selected at the top, then click Add Club Membership Query at the top right. 
      Screen Shot 2023-10-02 at 1.56.42 PM
    3. Give your Query a Title and click the Add Condition Group button.
      Screen Shot 2023-10-02 at 2.04.21 PM
    4. In the popup modal, choose the configurations for your Query
      1. Property Type: (Note that Property Type options will differ depending on the Query type). For this example, we are using 'Club Membership'. 
        1. A Club Membership meeting the subsequent conditions you setup.
        2. A Customer meeting the subsequent conditions you setup.
      2. Return Customers: Choose whether you'd like to see results that match the conditions or do not match the conditions. 
        Screen Shot 2023-10-02 at 2.06.04 PM
      3. Property: (Note that Property options will differ depending on the Query type): In this example, we are choosing the 'Club Status' property.
      4. Condition: (Note that Condition options will differ depending on Property chosen): In this example, we are choosing 'is equal to'.
      5. Value: (Note that Condition options will differ depending on Property chosen): In this example, we are choosing 'Active'.
      6.  If that is the only condition, click the Save Condition Group button.
        Screen Shot 2023-10-02 at 2.08.55 PM

    Need to add another parameter?

    Add Multiple Properties/Conditions using 'OR' or 'AND'. Learn how here.


    Stacking Conditions

    Now that your first set of conditions is complete, you can finish here and "Run Query" or you can optionally "stack" these conditions with another type of conditions - and here's how. Learn how here.


    Results

    Once you've clicked the Run Query button, you'll see an alert saying the query is running. It could take a few seconds to minutes depending on how many results there are. (You can refresh the page to see if it's still loading).

    You will see the results on the page (note that the results are clickable - they will take you to a Customer, Order, etc). You will also be emailed when the results are available for view in Commerce7.


    Once you've executed the query at least once, you can also Export or Tag your results or Customers included in these results.

    Learn more about exporting results or tagging results here.


        Reservations Queries

        The Query Builder allows you to create lists of Reservations based on certain criteria such as Experience Type, Reservation, etc. 

        1. Go to Marketing > Queries
        2. For customer queries make sure that Order is selected at the top, then click Add Reservation Query at the top right.
          Screen Shot 2023-10-02 at 2.31.22 PM copy
        3. Give your Query a Title and click the Add Condition Group button.
          Screen Shot 2023-10-02 at 2.43.35 PM
          1. Property Type: (Note that Property Type options will differ depending on the Query type). For this example, we are using 'Reservation'. 
            1. A Reservation meeting the subsequent conditions you setup.
            2. A Customer meeting the subsequent conditions you setup.
          2. Return Customers: Choose whether you'd like to see results that match the conditions or do not match the conditions. 
            Screen Shot 2023-10-02 at 2.45.00 PM
          3. Property: (Note that Property options will differ depending on the Query type): In this example, we are choosing the 'Reservation Date' property.In the popup modal, choose the configurations for your Query.
          4. Condition: (Note that Condition options will differ depending on Property chosen): In this example, we are choosing 'is greater than'.
          5. Value: (Note that Condition options will differ depending on Property chosen): In this example, we are choosing 'Jan 1, 2023'.
          6.  If that is the only condition, click the Save Condition Group button.
            Screen Shot 2023-10-02 at 2.47.01 PM


        Need to add another parameter?

        Add Multiple Properties/Conditions using 'OR' or 'AND'. Learn how here.


        Stacking Conditions

        Now that your first set of conditions is complete, you can finish here and "Run Query" or you can optionally "stack" these conditions with another type of conditions - and here's how. Learn how here.


        Results

        Once you've clicked the Run Query button, you'll see an alert saying the query is running. It could take a few seconds to minutes depending on how many results there are. (You can refresh the page to see if it's still loading).

        You will see the results on the page (note that the results are clickable - they will take you to a Customer, Order, etc). You will also be emailed when the results are available for view in Commerce7.


        Once you've executed the query at least once, you can also Export or Tag your results or Customers included in these results.

        Learn more about exporting results or tagging results here.


        Club Subscription Shipment Queries

        The Query Builder allows you to create lists of Subscription Club Shipments based on certain criteria such as Shipment Status, Order history, etc.

        1. Go to Marketing > Queries
        2. For customer queries make sure that Order is selected at the top, then click Add Club Subscription Shipment Query at the top right.
          Screen Shot 2023-10-02 at 3.09.53 PM copy
        3. Give your Query a Title and click the Add Condition Group button.
          Screen Shot 2023-10-02 at 3.39.13 PM
        4. In the popup modal, choose the configurations for your Query.
          1. Property Type: (Note that Property Type options will differ depending on the Query type). For this example, we are using 'Reservation'. 
            1. A Club Subscription Shipment meeting the subsequent conditions you setup.
            2. A Customer meeting the subsequent conditions you setup.
          2. Return Customers: Choose whether you'd like to see results that match the conditions or do not match the conditions. 
            Screen Shot 2023-10-02 at 3.43.23 PM
          3. Property: (Note that Property options will differ depending on the Query type): In this example, we are choosing the 'SKU' property.
          4. Condition: (Note that Condition options will differ depending on Property chosen): In this example, we are choosing 'is equal to'.
          5. Value: (Note that Condition options will differ depending on Property chosen): In this example, we are choosing 'ROSE7'.
          6.  If that is the only condition, click the Save Condition Group button.
            Screen Shot 2023-10-02 at 3.47.39 PM

        Need to add another parameter?

        Add Multiple Properties/Conditions using 'OR' or 'AND'. Learn how here.


        Stacking Conditions

        Now that your first set of conditions is complete, you can finish here and "Run Query" or you can optionally "stack" these conditions with another type of conditions - and here's how. Learn how here.


        Results

        Once you've clicked the Run Query button, you'll see an alert saying the query is running. It could take a few seconds to minutes depending on how many results there are. (You can refresh the page to see if it's still loading).

        You will see the results on the page (note that the results are clickable - they will take you to a Customer, Order, etc). You will also be emailed when the results are available for view in Commerce7.


        Once you've executed the query at least once, you can also Export or Tag your results or Customers included in these results.

        Learn more about exporting results or tagging results here.


        Traditional Club Shipment Queries

        The Query Builder allows you to create lists of Club Shipments based on certain criteria such as Shipment Status, Order history, etc.

         

        1. Go to Marketing > Queries
        2. For customer queries make sure that Club Member Shipment is selected at the top, then click Add Club Member Shipment Query at the top right.
          Screen Shot 2023-10-02 at 4.04.14 PM
        3. Give your Query a Title and click the Add Condition Group button.
          Screen Shot 2023-10-02 at 4.05.14 PM
        4. In the popup modal, choose the configurations for your Query.
          1. Property Type: (Note that Property Type options will differ depending on the Query type). For this example, we are using 'Reservation'. 
            1. A Club Member Shipment meeting the subsequent conditions you setup.
            2. A Customer meeting the subsequent conditions you setup.
          2. Return Customers: Choose whether you'd like to see results that match the conditions or do not match the conditions. 
            Screen Shot 2023-10-02 at 4.09.03 PM
          3. Property: (Note that Property options will differ depending on the Query type): In this example, we are choosing the 'Ship To State' property.
          4. Condition: (Note that Condition options will differ depending on Property chosen): In this example, we are choosing 'is equal to'.
          5. Value: (Note that Condition options will differ depending on Property chosen): In this example, we are choosing 'California'.
          6.  If that is the only condition, click the Save Condition Group button.
            Screen Shot 2023-10-02 at 4.09.14 PM

        Need to add another parameter?

        Add Multiple Properties/Conditions using 'OR' or 'AND'. Learn how here.


        Stacking Conditions

        Now that your first set of conditions is complete, you can finish here and "Run Query" or you can optionally "stack" these conditions with another type of conditions - and here's how. Learn how here.


        Results

        Once you've clicked the Run Query button, you'll see an alert saying the query is running. It could take a few seconds to minutes depending on how many results there are. (You can refresh the page to see if it's still loading).

        You will see the results on the page (note that the results are clickable - they will take you to a Customer, Order, etc). You will also be emailed when the results are available for view in Commerce7.


        Once you've executed the query at least once, you can also Export or Tag your results or Customers included in these results.

        Learn more about exporting results or tagging results here.


        Troubleshooting

        Is your Query "stuck" or otherwise will not execute? 

        Try re-running your Query. This will often clear the issue. If this does not work, feel free to reach out to Support.