Documentation

Query in Data Explorer

Build, execute, and visualize your queries in InfluxDB UI’s Data Explorer.

Query using saved scripts, the SQL builder, the Flux builder, or by manually editing the query. Choose between visualization types for your query.

Query data with SQL and the Data Explorer

  1. In the navigation menu on the left, click Data Explorer.

  2. Activate the SQL Sync toggle in the Schema Browser pane to build your SQL query as you select fields and tag values.

    • Typing within the script editor disables SQL Sync.
    • If you reenable SQL Sync, any selection changes you made in the Schema Browser are copied to the script editor.
  3. Select a Bucket to define your data source.

  4. Select a Measurement from the bucket. Data Explorer inserts a SELECT statement to retrieve all columns in the selected measurement:

    SELECT *
    FROM home
    
  5. To add filter conditions to your query, select from the Fields and Tag Keys lists.

    • Fields: filters for rows that have a non-null value for at least one of the selected field columns.
    • Tag Keys: filters for rows that have all the selected tag values. To learn more, see Query specific fields and tags.
  6. Use the time range dropdown to edit the time range for your query.

  7. Use the script editor to customize your query–for example, to specify what tags and fields to retrieve:

    SELECT temp, time
    FROM home
    
  8. Click the Run button (or press Control+Enter) to run your query and view the results.

See Query data to learn more about building SQL queries.

Save your work

Data Explorer keeps your last change–for example, if you navigate to Buckets or signout and then come back, you’ll see your SQL query and selections in Data Explorer.

To store a query that you can retrieve and reuse, Save your query as a script.

View SQL query results

After you Run your query, Data Explorer displays the results.

  • Click Table for a paginated tabular view of all rows and columns.
  • Click Graph to select a visualization type and options.
  • Click CSV to download query results in a comma-delimited file.

Query data with Flux and the Data Explorer

Flux is a functional data scripting language designed for querying, analyzing, and acting on time series data. See how to use Flux and SQL to query data.

  1. In the navigation menu on the left, click Data Explorer.

  2. Activate the Switch to old Data Explorer toggle to display the Flux builder. By default, the Cloud IOx UI displays the Schema Browser and the SQL script editor for creating queries.

    Data Explorer with Flux

  3. Use the bottom panel to create a Flux query:

    • Select a bucket to define your data source or select + Create Bucket to add a new bucket.
    • Edit your time range with the time range option in the dropdown menu.
    • Add filters to narrow your data by selecting attributes or columns in the dropdown menu.
    • Select Group from the Filter dropdown menu to group data into tables. For more about how grouping data in Flux works, see group().
  4. Alternatively, click Script Editor to manually edit the query. To switch back to the query builder, click Query Builder. Note that your updates from the Script Editor will not be saved.

  5. Use the Functions list to review the available Flux functions. Click a function from the list to add it to your query.

  6. Click Submit (or press Control+Enter) to run your query. You can then preview your graph in the above pane. To cancel your query while it’s running, click Cancel.

  7. To work on multiple queries at once, click the to add another tab.

    • Click the eye icon on a tab to hide or show a query’s visualization.
    • Click the name of the query in the tab to rename it.

Visualize your query

  • Select an available visualization type from the dropdown menu:

Control your dashboard cell

To open the cell editor overlay, click the gear icon in the upper right of a cell and select Configure. The cell editor overlay opens.

View raw data

Toggle the View Raw Data option to see your data in table format instead of a graph. Scroll through raw data using arrows, or click page numbers to find specific tables. Group keys and data types are easily identifiable at the top of each column underneath the headings. Use this option when data can’t be visualized using a visualization type.

View raw data

Save as CSV

Click the CSV icon to save the cells contents as a CSV file.

Manually refresh dashboard

Click the refresh button () to manually refresh the dashboard’s data.

Select time range

  1. Select from the time range options in the dropdown menu.

    Select time range
  2. Select Custom Time Range to enter a custom time range with precision up to nanoseconds. The default time range is 5m.

The custom time range uses the selected timezone (local time or UTC).

Query Builder or Script Editor

Click Query Builder to use the builder to create a Flux query. Click Script Editor to manually edit the query.

Keyboard shortcuts

In Script Editor mode, the following keyboard shortcuts are available:

KeyDescription
Control + / (⌘ + / on Mac)Comment/uncomment current or selected lines
Control + EnterSubmit query

Save your query as a dashboard cell or task

  • Click Save as in the upper right, and then:
    • To add your query to a dashboard, click Dashboard Cell.
    • To save your query as a task, click Task.
    • To save your query as a variable, click Variable.

Was this page helpful?

Thank you for your feedback!


Introducing InfluxDB 3.0

The new core of InfluxDB built with Rust and Apache Arrow. Available today in InfluxDB Cloud Dedicated.

Learn more

State of the InfluxDB Cloud Serverless documentation

The new documentation for InfluxDB Cloud Serverless is a work in progress. We are adding new information and content almost daily. Thank you for your patience!

If there is specific information you’re looking for, please submit a documentation issue.

InfluxDB Cloud Serverless powered by IOx