Pick the data
Search for data items with--type data. The result also lists the columns (name and type) and the row count.
Check the columns
Check the column names and types before you aggregate. A name must be written exactly.--detail light returns only the column names, types and the row count.
To look at the rows, get the first few.
Filter and aggregate
This example sums the sales column for each value of the region column and returns the top 5, largest first.--modeaggregate groups by--dimensionsand calculates--metrics.--moderows gets the rows that match the conditions. Name the columns to return with--columns.- rows returns at most 1,000 rows and aggregate at most 500. There is no paging. When has_more in the result is true, narrow the query or aggregate.
- The result includes the data version and update time. When you report the numbers, say which data they are based on.
--mode rows. It needs --columns, and --filters narrows the rows. This example returns two columns of the rows where region is Kanto.
expl server dataframe get-schema <id> --detail full. For how to combine several conditions, see Filter conditions.
When the result is too large, save it as a CSV or Parquet file with dataframe export. To join several data items, see the dataset query page.
Write the JSON arguments
JSON is a text format for writing structured data. Pass dimensions, metrics, sort and similar flags as JSON. Wrap the whole JSON in single quotes (’) and write the strings inside in double quotes (”).
The alias in metrics is required. Use only letters, digits and _, do not start with a digit, and use at most 64 characters. In sort, name the output column with field.
These are the messages you see for a wrong shape, and how to fix them.
Data that cannot be queried
Data published without its full data cannot be queried on the server. dataset query then fails with this error.
Search results and
--detail light do not show whether a data item can be queried. Run --detail full and check that query.available in the result is not false.
