Compare areas on an ILOSTAT dataset
ilostat_compare_geographiesCompare reference areas on one ILOSTAT dataset and one slice — a sex code plus breakdown codes, defaulting to the dataset's totals — giving each area's value at a common period or at its latest non-projected period, optional change over N years, and a rank, with each value's period, source, status, and basis (reported, modelled_estimate, or projection). Areas without a value are listed separately with the reason, and the response flags mixed periods and mixed bases rather than hiding them. Select areas by code list, by group (X01 for every country, an ILO region or subregion, or a World Bank income group), or both; X-coded aggregates require a dataset with aggregates.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sex | No | Sex code SEX_T, SEX_M, SEX_F, or SEX_O; T/M/F/O and total/both/male/female/other are accepted. Defaults to SEX_T on a dataset with a sex breakdown; refused on one without. | |
| sort | No | Row order: value_desc (default), value_asc, or ref_area. rank is always by value, highest first. | value_desc |
| period | No | A common period, YYYY, YYYYQn, or YYYYMmm matching the dataset frequency (2024-Q2 and 2025-03 are normalized). Omit to compare each area at its latest period. | |
| classif1 | No | First breakdown code, case-insensitive. Defaults to the dataset's total code; required when the breakdown has no total (deciles); refused on a dataset without the breakdown. ilostat_describe_indicator lists the dataset's codes and marks its totals. | |
| classif2 | No | Second breakdown code; same defaults and rules as classif1. | |
| ref_areas | No | Reference areas (up to 300): ISO3 codes (USA) or X-coded aggregates (X01 World); case-insensitive, ILO_GEO_ forms accepted. At least one of ref_areas or area_group is required. | |
| area_group | No | X01 for every country, an ILO region or subregion, or a World Bank income group (X06, X56, X02, …); expands to its member countries. The group's own aggregate is compared only when listed in ref_areas. ilostat_list_reference topic area_groups lists the codes. | |
| dataset_id | Yes | One dataset ID (UNE_DEAP_SEX_AGE_RT_A), as ilostat_search_indicators returns it; case-insensitive, a DF_ prefix (the SDMX dataflow form) stripped, a bare indicator code resolved when it has one frequency. | |
| change_years | No | Adds each value's change from the same sub-period this many years earlier, in the dataset unit. | |
| lookback_years | No | Latest mode: an area's latest value must fall within this many years of the current year. | |
| include_projections | No | Latest mode: let projections (ILO modelled values after the cutoff) be an area's latest value. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cap | No | Inline preview budget, in serialized characters. | |
| mode | No | latest: each area's latest value; period: every area at one period. | |
| rows | No | Areas with a value, in the requested order; the staged dataframe holds all when larger. | |
| error | No | Present when the call failed. Absent on success. | |
| shown | No | Rows returned inline. | |
| slice | No | The one series compared per area. | |
| legend | No | Labels for the status flags and note codes in rows. | |
| notice | No | Mixed periods, mixed bases, missing areas, a unit or area list the structure service could not supply, where the full comparison is staged, or why the inline rows stop early. | |
| period | No | Period mode: the period compared. | |
| dataset | No | One requested dataset and how its values are classed. | |
| missing | No | Requested areas with no value, and why. | |
| dataframe | No | The staged dataframe holding the full result; present only when staged. | |
| truncated | No | True when the inline rows stop before the last area — also when a dataframe holds the full comparison. | |
| attribution | No | Citation to keep with any use of the data. | |
| window_from | No | Latest mode: the first year requested — lookback_years before the current year, and change_years further back to reach the change base. A latest value still falls within lookback_years. | |
| change_years | No | Years the change is measured over, when requested. | |
| comparability | No | What makes the values more or less comparable, over every area. | |
| applied_filters | No | Every parameter sent upstream. | |
| include_projections | No | Whether a projection could be an area's latest value. |