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. The database must include the COUNTRIES attribute.

Sub Main;

Var

TextConsumer: IDtTextConsumer;

MB: IMetabase;

Exporter: ICubeMetaExporter;

Binding: ICubeMetaExporterBinding;

Filter: ICubeMetaExporterFilter;

FilterValues: Array;

Begin

// Data consumer for exporting to the textual 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 parameters

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 Main;

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.

Example of export file fragment

See also:

ICubeMetaExporterBinding