Asking Questions & Querying

Asking Questions

From the Zing App you’ll see two sections:

  • Tables show all visible tables and views of any of your database(s). If you have multiple data sources configured in Zing, you’ll see all visible tables and views from all data sources you have set up or which have been shared with you.
  • Questions are questions you save or that other people in your organization have shared with you. Tap a question to view the graph or table of results, or to clone an existing question to make it your own. You can also comment on questions to participate in a conversation, and anybody who is part of that conversation will be notified by email of your comment.

From either a table or a cloned question, select fields and aggregations by tapping and holding on field names. You can tap on a field, hold and drag down – all in one motion – and select an aggregation.

Selecting Fields

  • Select a field simply by tapping on it. Blue is selected, grey is unselected.
  • Tap and hold on a field to see aggregations for that field.

Aggregations and Filters

  • Tap and hold a field to see available aggregations and filters, including. Available aggregations and filters are:
    • SUM displays the sum of all numeric values
    • COUNT displays the number of rows in the database (which meet all the filter conditions across fields in your query)
    • AVERAGE displays the mean value across all rows in the database
    • GROUP BY groups rows that have the same value – useful for summarizing results by a category (e.g. “Sales by City” if those cities are represented multiple times in a table)
    • When a Condition is Met lets you filter rows:
      • Equals only returns results which match the value you input (e.g. “City equals ‘New York’” will return results only where the city field for that row equals New York)
      • Does Not Equal returns results which do not match the value you input (e.g. “City does NOT equal ‘New York’” would return all cities except New York)
      • Greater than returns results which are greater than the value you input
      • Greater than or equal returns results which are greater than or equal to the value you input
      • Less than returns results which are less than the value you input
      • Less than or equal returns results which are less than or equal to the value you input
      • Between returns results which are between the two values you specify. For date fields this will be two dates and Zing will display a date selector to easily select dates.
      • Includes returns results which include part or all of the value you input. For instance “City includes ‘San’” would return “San Francisco” and “San Diego” if those values are present in the data.
      • Excludes returns results which do not include any of the value you input. For instance “City excludes ‘San’” would return all cities which do not contain “San” in their name so “New York” and “Boston” would be part of the result set, but “San Diego” and “San Francisco” would not)

Note that not all fields will show all of the aggregations mentioned above because Zing only shows the aggregations which are relevant – for instance a string field won’t show “greater than” or “less than” as an option because those are only relevant for dates and numeric fields.

Search

From the main screen, you can search any table names using the search bar at the top of the app.

Once you’ve tapped on a table, you’ll see all fields in that database. You can search across all fields using the search bar at the top of the screen.

Custom SQL

You can also use the Zing Custom SQL editor for more sophisticated use cases. A helpful typeahead that auto-completes aggregations like (SUM, COUNT, MIN, MAX, GROUP BY, etc.), and field names.

You can join across tables from the same data source as well.

To access the custom SQL typeahead:

  • Select a table from the home screen
  • Tap the three dots in the upper left and then ‘Write custom SQL’
  • Write your query and then tap ‘Run’

Note that for custom SQL:

  • Only ‘select’ statements are supported. Insert / Update / Creates / Drop are not.
  • For Google BigQuery data sources, tables are referenced as ‘project_id.schema.tablename’ for instance light-quest-122122.austin_bikeshare.bikeshare_trips