Skip to main content
You can reference the results of any completed query run in a new query. This enables you to build multi-stage analyses, perform additional aggregations, or join datasets without re-executing expensive queries.

How It Works

1

Run Your Initial Query

Execute any query in the Allium App. Once complete, the results are stored and can be referenced by other queries.
2

Access Run History

On the query editor page, click View Run History to see all completed runs:
Query run history
3

Copy the Run ID

Find the query run you want to reference and click the copy button to copy its Run ID.
4

Reference in a New Query

Use the Run ID in a new query with the format query_history.<query_run_id>:
You can perform any SQL operations on the query history results, including joins, aggregations, and filtering.

Time Limits

Query History Time Constraints
  • Mixed queries: When combining query_history results with Allium data tables, query results must be less than 24 hours old
  • Query history only: When querying exclusively from query_history tables, there is no time limit

Use Cases

Querying previous results is useful for:
  • Breaking down complex analyses into manageable steps
  • Joining pre-computed datasets without re-running expensive queries
  • Performing multiple aggregations on the same base dataset
  • Creating derived tables for further analysis
  • Iterating on analysis without recomputing source data

Example: Multi-Stage Analysis

Next Steps

Basic Queries

Learn the fundamentals of running queries

Parameterized Queries

Create reusable queries with configurable parameters

Explorer API

Access query results programmatically

Compute Profiles

Optimize performance for complex queries