Skip to content

Eurostat Data for Calc 1.0.3

Choose a tag to compare

@davidjayjackson davidjayjackson released this 09 Jul 22:26

⚠️ Superseded — do not install. This release breaks any spreadsheet saved with EUROSTATDATA under 1.0.1/1.0.2 (formulas show #NAME? until retyped). Use v1.0.4 instead, which fixes the duplicate-listing bug below correctly and also repairs files broken by this release.

Patch release. Fixes EUROSTATDATA showing up twice in the Function Wizard.

  • Duplicate function listing: the function was registered through two mechanisms at once —
    the interface-based XAddIn implementation in EurostatAddin.java, and the declarative
    packaging/CalcAddIns.xcu added in 1.0.1 to fix a different registration problem. Both were
    exposing EUROSTATDATA to Calc simultaneously, so it appeared twice under Add-in in
    Insert ▸ Function. Removed the now-redundant XAddIn/XLocalizable methods from the Java
    class, leaving CalcAddIns.xcu as the single source of registration.
  • New: filters cheatsheeteurostat-filter-cheatsheet.pdf
    below is a 3-page quick reference for the filters argument: syntax, the one-value-per-key
    gotcha, Eurostat's reserved query parameters (sinceTimePeriod, lastTimePeriod, lang,
    precision, geoLevel), and commonly-seen dimension keys (geo, time, unit, sex, age,
    and more). Also linked from the README.

Install

Download EurostatAddin-1.0.3.oxt below, then either double-click it to open the Extension
Manager, or:

/path/to/libreoffice/program/unopkg add EurostatAddin-1.0.3.oxt

If you have an older version installed, restart Calc after installing so the Function Wizard
picks up the corrected registration.

Usage

=EUROSTATDATA(datasetCode; filters)
  • datasetCode — a Eurostat dataset code, e.g. nama_10_gdp.
  • filters — optional dimension filters as key=value pairs separated by ;, e.g.
    "geo=DE;time=2023;unit=CP_MEUR". Pass "" for no filtering. See the
    filters cheatsheet
    below for syntax, gotchas, reserved parameters, and common dimension keys.

Enter it as an array formula so the whole table spills out: select a range large enough for the
result, type the formula, and confirm with Ctrl+Shift+Enter (recent LibreOffice versions with
dynamic array support will spill automatically from a single cell).

Returns a table: a header row (one column per dimension, plus value), followed by one row per
observation. Errors show as a readable #ERROR: ... cell instead of Err:5xx.

=EUROSTATDATA("nama_10_gdp"; "geo=DE;time=2023;unit=CP_MEUR")
=EUROSTATDATA("une_rt_a"; "geo=FR;time=2023")
=EUROSTATDATA("tec00118"; "geo=DE;sinceTimePeriod=2015")

The last example uses sinceTimePeriod, one of Eurostat's own reserved query parameters (not a
dimension) — useful for pulling a whole year range back in one call. lastTimePeriod works the
same way. Any filter key you pass goes straight into the API query string.

Try it

Download Eurostat-Demo.ods
below — it has several EUROSTATDATA(...) formulas already entered and computed against live
data, so opening it (after installing the add-in above) shows the function working right away.
This is the same demo file as 1.0.1/1.0.2 — no data changes in this release.