Postman collection
Statistics Read

pixiFederalStatisticReport

Returns a monthly federal statistics (Intrastat-style) report of delivered supplier items, grouped by supplier country, customs tariff number and country of origin.

Builds a report of goods received from suppliers for the federal foreign-trade statistics.

Time span

  • If DateFrom is omitted, it defaults to the first day of the previous calendar month.
  • If DateTo is omitted, it defaults to the last day of the previous calendar month.
  • DateFrom is moved to the start of its day (00:00:00) and DateTo to the end of its day (23:59:59.997), so only the date part matters.
  • If DateTo is not after DateFrom, or the span covers more than 24 months, an error row is returned instead of the report.

Selection

  • Supplier deliveries (SDelHeader) with status INV (invoiced) or CLS (closed).
  • The delivery header's last update date (SDelHUpdateDate) must lie within the time span.
  • Only delivery lines with a delivered quantity greater than 0.
  • Optional filter on the supplier number SupplNR; it is trimmed, and an empty value means all suppliers.

Aggregation Rows are grouped by year and month of the update date, the supplier country (ISO2 code, N/A if the supplier has no known country), the Artikel's customs country of origin, customs tariff number, customs tariff text (falls back to the Artikel name if empty) and the supplier's home page URL. For each group the call returns the summed weight (Artikel weight × delivered quantity, cast to int), the summed delivered quantity and the summed amount (delivered quantity × final supplier price, as money).

The result is sorted by year, month and supplier country.

Notes

  • All tables are read WITH (NOLOCK); results may include uncommitted data.
  • Errors (including the parameter checks) are caught and returned as a row with Status = Error and Message, not as a SOAP fault.
  • The period is based on SDelHUpdateDate (last change of the delivery header), not on a separate receipt date. A later change to an old delivery moves it into a later period.
  • If only DateFrom is passed, DateTo still defaults to the end of the previous month; a DateFrom in the current month therefore leads to the error about DateTo being smaller.
  • The 24-month check uses DATEDIFF(MONTH, ...), which counts month boundaries, not full months.
  • The supplier number is not part of the grouping, but HomePageUrl is: several suppliers from the same country with different home page URLs produce separate rows.
  • Artikel without weight (NULL) do not contribute to DeliveredWeight. The weight is truncated to an integer after summing.
  • The helper util.TempTableDrop used to drop the temporary table is not attached.

Tables used

SDelHeader · Read SDelDetail · Read Items · Read Suppliers · Read Countries · Read
SQL object:
dbo.pipiFederalStatisticReport
Updated at 2026-10-30