statswales_create_query: Create a stored query and return its filter ID

View source: R/statswales_create_query.R

statswales_create_queryR Documentation

Create a stored query and return its filter ID

Description

Submits a set of filters and display options to the API and returns the resulting filter ID. The same inputs always produce the same ID, so this is useful for building shareable, reproducible data requests.

Usage

statswales_create_query(
  dataset_id,
  filter = NULL,
  options = list(use_raw_column_names = FALSE, use_reference_values = FALSE,
    data_value_type = "formatted")
)

Arguments

dataset_id

A dataset UUID string. Use statswales_list_datasets() to find dataset IDs.

filter

Filter criteria in the same format as statswales_get_dataset().

options

Display options in the same format as statswales_get_dataset().

Details

Pass the returned filter_id to statswales_get_query() to inspect the query configuration, or use it directly in statswales_get_dataset() / statswales_download_dataset() workflows.

Value

A character string containing the 12-character filter ID, or NULL if the request fails.

Examples

## Not run: 
datasets <- statswales_list_datasets()
id <- datasets$id[1]

fid <- statswales_create_query(id)
statswales_get_query(id, fid)

## End(Not run)


statswalesr documentation built on July 12, 2026, 5:06 p.m.