ScaleValues: Boolean;
The ScaleValues property determines whether data must be normalized on export.
When the False value is set, data of every factor is loaded with measurement unit scale specified for it. Therefore, the uploaded data is non-uniform. When the True value is set, exported data is normalized that is it is brought to one measurement unit scale.
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;
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;
Exporter.ScaleValues := True;
// The COUNTRIES attribute binding
Binding := Exporter.Bindings.Add;
Binding.FieldName := "CountryKey";
Binding.DataType := DbDataType.Integer;
Binding.BindingType := CubeMetaExporterBindingType.Attribute;
Binding.Attribute := "COUNTRIES";
Binding.KeyField := "KEY";
// Calendar binding
Binding := Exporter.Bindings.Add;
Binding.FieldName := "Year";
Binding.DataType := DbDataType.String;
Binding.BindingType := CubeMetaExporterBindingType.Calendar;
Binding.DateFormat := "$Year$";
Binding.ValueFieldName := "Value";
Binding.ValueDataType := DbDataType.Float;
Exporter.ByColumns := False;
Exporter.CalendarLevel := DimCalendarLevel.Year;
// Export
Exporter.Export;
End Sub Main;
After executing the example factors are exported to the C:\result_meta_exp.txt file. Exported data is normalized.
See also: