Functions Data

MetaData

The MetaData() function retrieves information about data stored in the Quintessence database.


Syntax:

  • In Excel with Quintessence addin versions prior to 25.1, use: MetaData()
  • In the Quintessence Editor (Studio) using Quintessence language, use: MetaData()
  • In the Quintessence Editor (Studio) using Python language, use: Qx.MetaData()
 See parameter descriptions

TypeThe type of data to query.
ParameterThis parameter limits the output to the specified type of data being queried.
ViewDefines how the data should be displayed. Options include:
• none return default columns without headers
• DataView():headers return columns with or without headers
See more on DataView.

The following is a complete list of Type and Parameter options available for MetaData(). Null refers to leaving the Parameter field blank.

TypeParameterDescription
TimeSeriesNullRetrieve all TimeSeries
TimeSeriesEntityRetrieve all TimeSeries maintained for an entity
TSVDNullRetrieve all TSVDs
TSVDTimeSeriesRetrieve all TSVDs maintained for a TimeSeries
Entity TSVDTimeSeriesRetrieve Entity TSVDs information
RelationshipNullRetrieve all Relationships
ReportsNullRetrieve the names of all reports
QualitativesetsNullRetrieve a list of all Qualitative (Enum) sets
QualitiesQualitativeSetRetrieve a list of all the Qualities in a Qualitative Set
CurrencyNullRetrieve a list of all currencies
ExchangeNullRetrieve a list of all exchanges
CountryNullRetrieve a list of all countries
AuthorNullRetrieve a list of all authors
UsersNullRetrieve the names of all users

Remarks:

  • Unless changed by an administrator, the default parameters are:
    • View: none.
  • When using DataView for the View parameter, we recommend using DataView(*):column to display all columns with headers initially, then replace * with the specific columns you need. Unlike other functions, the columns returned by MetaData() vary depending on the Type specified.

Examples:

The examples provided below are based on fictitious data for illustrative purposes only.

> Example 1: Determine entities sharing the same TimeSeries as StockEntity1.


First, we can determine which TimeSeries are used by StockEntity1.

=Qx.MetaData("TimeSeries", "StockEntity1", "dataview(Name)")
Name
Price

Now, we can use this output to identify which other entities also use Name and Price. When using MetaData(), we may receive repeated entity codes due to different TSVDs. To ensure we retrieve a distinct list, we apply the Unique() function.

=Qx.Unique(Qx.MetaData("Entity TSVD", "Name, Price", "dataview(Entity)"))
StockEntity1
StockEntity6
StockEntity8

For some Parameter options, you can pass in an array. In this example, passing an array allows the logic to be written as a single line.

=Qx.Unique(Qx.MetaData("Entity TSVD", Qx.MetaData("TimeSeries", " StockEntity1", "dataview(Name)"), "dataview(Entity)"))
> Example 2: Retrieve a list of all authors who are not used in any TSVDs.


First, we retrieve all authors in Quintessence (for example, storing the result in a variable called get_authors).

=Qx.MetaData("Author",, "dataview(Code)")
AuthorUser1
AuthorUser2
AuthorUser3

Next, we retrieve all authors used in TSVDs. When using MetaData(), we may receive repeated entity codes due to different TSVDs. To ensure we obtain a distinct list, we use the Unique() function (storing the result in a variable called get_tsvd_authors).

=Qx.Unique(Qx.MetaData("TSVD",, "dataview(Author)"))
NA
AuthorUser2

With this information, we can now identify authors who are not included in any TSVDs by using the SetDifference() function.

=Qx.SetDifference(get_authors, get_tsvd_authors)
AuthorUser1
AuthorUser3

This result can also be achieved using the following one-liner.

=Qx.SetDifference(Qx.MetaData("Author",, "dataview(Code)"), Qx.Unique(Qx.MetaData("TSVD",, "dataview(Author)")))
> Example 3: Find all sources used in Local Data Warehouse TSVDs.


Note: The Local Data Warehouse is also referred to as Simple Sources or the Q Database.

To achieve this, follow these steps:

  1. Retrieve all sources and their data locations.
  2. Use the FilterData() function to identify which TSVDs originate from the Local Data Warehouse.
  3. When using MetaData(), you may receive repeated entity codes due to different TSVDs. To ensure a distinct list, apply the Unique() function.
=Qx.Unique(Qx.FilterData(Qx.MetaData("TSVD",, "dataview(*):both"), "[Type] = 'Local Data Warehouse'", "[Source]"))
Source
MarketDataProvider1
MarketDataProvider2