ICubeMetaExporterBinding.DynamicsFormat

Syntax

DynamicsFormat(Level: DimCalendarLevel): String;

Description

The DynamicsFormat property determines format of frequency in a calendar dimension.

Comments

Frequency is set in the date format (ICubeMetaExporterBinding.DateFormat) with the $Dyn$ identifier.

If frequency format is not determined, default values are used:

The Level parameter value Frequency format
DimCalendarLevel.Year "A"
DimCalendarLevel.HalfYear "S"
DimCalendarLevel.Quarter "Q"
DimCalendarLevel.Month "M"
DimCalendarLevel.Week "W"
DimCalendarLevel.Day "D"

Example

Executing the example requires a time series database with the OBJ_RUBRICATOR identifier. This database must include the COUNTRIES attribute. The file system must contain the C:\result_meta_exp.txt file with indicator values.

Example of export file fragment

Sub UserProc;
Var
    TextConsumer: IDtTextConsumer;
    MB: IMetabase;
    Exporter: ICubeMetaExporter;
    Binding: ICubeMetaExporterBinding;
    Filter: ICubeMetaExporterFilter;
    FilterValues: Array;
Begin
    // Data consumer for export to text format
    TextConsumer := New DtTextConsumer.Create;
    TextConsumer.File := "C:\result_meta_exp.txt";
    TextConsumer.FormatType := DtTextFormatType.Delimited;
    TextConsumer.DelimitedColumnDelimiter := ";";
    TextConsumer.DelimitedTextQualifier := """";
    TextConsumer.Encoding := "WIN";
    TextConsumer.WriteHeader := True;
    // Export options
    Exporter := New CubeMetaExporterClass.Create;
    MB := MetabaseClass.Active;
    Exporter.Rubricator := MB.ItemById("OBJ_RUBRICATOR").Bind As IRubricator;
    Exporter.Consumer := TextConsumer As IDtConsumer;
    Binding := Exporter.Bindings.Add;
    Binding.FieldName := "CountryKey";
    Binding.DataType := DbDataType.Integer;
    Binding.BindingType := CubeMetaExporterBindingType.Attribute;
    Binding.Attribute := "COUNTRIES";
    Binding.KeyField := "KEY";
    Binding := Exporter.Bindings.Add;
    Binding.FieldName := "Date";
    Binding.DataType := DbDataType.String;
    Binding.BindingType := CubeMetaExporterBindingType.Calendar;
    Binding.DateFormat := "$Dyn$_$Year$-$Quarter$";
    Binding.DynamicsFormat(DimCalendarLevel.Year) := "A1";
    Binding.DynamicsFormat(DimCalendarLevel.Quarter) := "Q1";
    Binding.ValueDataType := DbDataType.Float;
    Binding.ValueFieldName := "Value";
    Binding.ValueDataType := DbDataType.Float;
    Exporter.ByColumns := False;
    Exporter.CalendarLevel := DimCalendarLevel.None;
    Filter := Exporter.Filters.Add;
    Filter.Attribute := "COUNTRIES";
    FilterValues := New Variant[2];
    FilterValues[0] := 512;
    FilterValues[1] := 914;
    Filter.ValuesList := FilterValues;
    // Export
    Exporter.Export;
End Sub UserProc;

After executing the example indicators are exported to the C:\result_meta_exp.txt file. Data is exported only for the indicators, which COUNTRIES attribute's value is equal to 512 or 914.

See also:

ICubeMetaExporterBinding