ETL

Data Catalog: Units

205 views September 10, 2018 September 10, 2019 admin 0

UDM team maintains a carefully curated metadata structures for each value we store in our databases. Each value stored in the database belongs to one, and only one Series. Each Series has one and only one Unit. Examples of units are “€/100kg“, “MT“, or “Canadian dollars to One U.S. Dollar“.

The data catalog endpoint with the full list of all Units is /UDM_Catalog_Units. The fields are:

  • UnitID (int, not null)
  • UnitName (nvarchar(200), not null)
  • UnitDescription (nvarchar(50), not null)
  • LastModified (datetime2(6), not null)
  • Active (bit, not null)

UnitID is the unique identifying number assigned to each unit, i.e. the primary key for the table where this data resides. UnitName is the symbolic label used to describe the value. e.g. “¢/bu“. UnitDescription is the verbose description of the symbols used in the UnitName. In this example: “Cents per bushel“. The feed UDM_Catalog_Units contains the timestamp field LastModified which can be used to facilitate incremental pulls. No record is ever hard-deleted from the underlying UDM database table. Instead, soft-deleted records have Active field set to 0. Soft-delete principle in conjunction with the timestamp of last change allows the users to optimize their data pulls by only requesting those fields that have been modified since the last time the data feed was pulled. For example, the request to the server may be:

http://udmdirect.dairymarkets.com/Universal/UDM_Catalog_Units?$filter=LastModified gt DateTime’2018-09-08T08:30:00.0000000′

or more simply:

http://udmdirect.dairymarkets.com/Universal/UDM_Catalog_Units?$filter=LastModified gt DateTime’2018-09-08′

To add this table to your database:

 

CREATE TABLE [Report].[Catalog.Units](
[UnitID] [int] NOT NULL,
[UnitName] [nvarchar](400) NOT NULL,
[UnitDescription] [nvarchar](200) NULL,
[LastModified] DATETIME2(6) NOT NULL,
[Active] BIT NOT NULL,
CONSTRAINT [PK_Catalog.Units] PRIMARY KEY ([UnitID])
)
GO 

See related Knowledge Base articles: 

 

Was this helpful?