custom_query
Execute a custom data query on a statistical dataset by specifying dimensions for columns, rows, and filters. Use this tool when predefined selections are insufficient.
Instructions
Execute a custom data query on a dataset (advanced).
IMPORTANT: Prefer get_selection_data() for predefined tables — it is much simpler and more reliable. Use custom_query only when no suitable predefined selection exists.
Caveats:
All dataset dimensions must be placed in columns, rows, or table_filters.
Datasets with multiple time dimensions (e.g., CasM + CasR + CASRMX) may only work with certain dimension combinations matching predefined selections.
Hierarchical territory dimensions may need "filtr" with "urovenHierarchieKod".
Args: dataset_code: Dataset code. dataset_version: Dataset version string from get_dataset(). columns: Column dimensions. Each dict must have "kodDimenze" (str). Optionally add "filtr" with [{"zobrazitPolozky": ["code1","code2"]}]. rows: Row dimensions. Same structure as columns. Use "kodDimenze": "#UKAZATEL" to put indicators as rows. table_filters: Header/filter dimensions. Same structure, but can also include "filtrTabulkyKod" (str) to filter to a single item. max_rows: Max CSV rows to return.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dataset_code | Yes | ||
| dataset_version | Yes | ||
| columns | Yes | ||
| rows | Yes | ||
| table_filters | No | ||
| max_rows | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |