DATA LOAD RULES FILES / REGLA PARA SUBIDA DE DATOS

English (Español a continuación)

To create a «Loading Rule» for uploading data:

  • Click with the right-button on the database, select «Create» -> «Rules file».
  • The «Data Prep Editor» window opens with a blank template and a menu at the top.

In the top menu of the console we select «File» -> «Open data file» and we select the data file that we want to upload.

The first thing we have to do is to indicate how the columns are separated in this file (for example, suppose they are separated with a » ; «):

  • In the upper menu of the «Data Prep Editor» we select «Data source properties» -> «Delimiter» and select the one that corresponds.
  • In our example we select «Personalized» and indicate » ; » (Accept).
  • The different columns that make up the data file are already shown separately in the template.

In the upper menu of the «Data Prep Editor» we select «Data load fields».

Then in that upper menu we select «Field properties» and in the drop-down we select «Data load properties».

Let’s assume that the field structure of the data file does not exactly match the Outline structure:

So in the «Loading Rule» we will have to make the necessary adjustments.

We are going to go field by field of the data file assigning them to the corresponding dimensions.

1.- Country: this dimension appears in the Outline but does not appear in the data file. We are going to assume that all the information in this file corresponds to Spain. We are going to create this field.

  • In the upper menu of the «Data preparation editor» we select the option «Create using text» in which we are going to indicate Spain.
  • We return to the menu «Field properties» -> «Data load properties» and select the «Country» dimension.

2.- City: we assign it to the “City” dimension.

3.- Vendor: We are going to suppose that the format that comes in the data file is different from that of the Outline: Let us suppose that the Outline contains “ESP_Surname” (initials of the country, followed by an underscore and the surname), while in the text file only the last name appears.

  • In «Field properties» we select «Global properties» and prefix we add «ESP_».
  • In “Data load properties” we assign this column to the “Vendor” dimension.

4.- Product: this field comes in the data file but not in the Outline. In «Data loading properties» we select «Ignore field during data load».

We are faced with the following problem: if the same vendor has several data records (one for each product) when this field is ignored when loading, the records will be coincident, so when uploading the data only one record would be registered (the last from them).

Example:

As we need to add all the data of that vendor (of the different products), we have to indicate this property:  when it finds a matching record instead of overwriting the previous one, add the data:

  • In the menu «Data Prep Editor» -> «Data load settings» -> «Data values» -> «Add to existing values».

5.- Date: we are going to suppose that the format is different in the Outline and in the data file:

  • While in the Outline we have two dimensions: Year and Month, in the data file the date comes in a single field with the format DD-MM-YYYY. For example: 01-23-2020.

In the «Loading Rule» we have to divide this field into 3 columns:

In the menu «Data preparation editor» -> «Split field»; we indicate in «Number of characters in a column» 3:

  • The field is initially divided into 2 columns: «23-» and «01-2020»

The first column with the first 3 positions («23-«) in «Field properties» -> «Data load properties» select » Ignore field during data load «.

In the next column «01-2020» we select «Divide field» again and indicate in «Number of characters in a column» 3:

  • This field is divided into 2 other columns: «01-» and «2020»

In the first column «01-«, corresponding to the month, we have to carry out the following conversion (let’s suppose that in the Outline this field comes in text):

In «Field properties» -> «Global properties» we indicate «Replace» / «By»:

After Accepting, we assign this column to the dimension «Month».

The third column («2020») is assigned to the dimension «Year».

6.- Objective and Sale: the following columns of the data file «Objective» and «Sale» are assigned directly to the dimensions «Objective» and «Sale».

Once all the columns have been assigned to the corresponding dimensions, in the upper menu of the «Data preparation editor» we click on «Validate» and save.

  • We already have the «Rules file» ready for uploading data.

Map a column of data to multiple dimensions

When defining a data load rule it is possible to assign a column of data to multiple dimensions.

Let’s see an example: we have the following outline and data file structure:

Let’s assume that this data file exclusively brings information from a country (France), a city (Paris), a seller (Pierre) and a year (2020).

We have 2 possibilities:

a) Create in the load rule 4 text fields with these data (France, Paris, Pierre, 2020) and assign them to these 4 dimensions (Country, City, Seller, Year), as we saw previously (treatment given in point 1 to the “Country” dimension).

b) Assign the data columns (Target and Sale) to all the dimensions involved:

  • Target: France -> Paris -> Pierre -> 2020 -> Target
  • Sale: France -> Paris -> Pierre -> 2020 -> Sale

The data load rule would be:

Data upload

  • Right button on the base and in the drop-down we select “Load data”: in the window that opens we select the data file that we want to upload with the data rule that we have prepared.
  • We have to check that the option «Overwrite» is disabled so that it adds the matching records.
  • Accept.

Español

Para crear una “Regla de Carga” para subida de datos:

  • Hacemos click con el botón derecho sobre la base de datos, seleccionamos “Crear” -> “Archivo de reglas”.

Se abre la ventana “Editor de preparación de datos” con una plantilla en blanco y con un menú en la parte superior.

En el menú superior de la consola seleccionamos “Archivo” -> “Abrir archivo de datos” y seleccionamos el fichero de datos que queremos subir.

Lo primero que tenemos que hacer es indicarle a Essbase como vienen separadas en este fichero las columnas (por ejemplo, supongamos que vienen separadas con un “;”):

  • En el menú superior del “Editor de preparación de datos” seleccionamos “Propiedades de origen de datos”-> “Delimitador” y seleccionamos el que corresponda.
  • En nuestro ejemplo seleccionamos “Personalizado” e indicamos “ ; “ (Aceptar).
  • En la plantilla se muestran ya separadas las distintas columnas que configuran el fichero de datos.

En el menú superior del “Editor de preparación de datos” seleccionamos “Campos de carga de datos”.

A continuación en ese menú superior seleccionamos “Propiedades de campo” y en el desplegable seleccionamos “Propiedades de carga de datos”.

Vemos a suponer que la estructura de campos del fichero de datos no coincide exactamente con la estructura del Outline:

Por lo que en la “Regla de Carga” tendremos que realizar los ajustes necesarios.

Vamos a ir campo por campo del fichero de datos asignándolos a las dimensiones correspondientes.

1.- País: esta dimensión figura en el Outline pero no figura en el fichero de datos. Vamos a suponer que toda la información de este fichero corresponde a España. Vamos a crear este campo.

  • En el menú superior del “Editor de preparación de datos” seleccionamos la opción “Crear un campo mediante texto” en el que vamos a indicar España.
  • Volvemos al menú “Propiedades de campo” -> “Propiedades de carga de datos” y seleccionamos la dimensión “País”.

2.- Ciudad: la asignamos a la dimensión “Ciudad”.

3.- Vendedor: Vamos a suponer que el formato que viene en el fichero de datos es diferente al del Outline: Supongamos que en el Outline vienen recogido “ESP_Apellido” (iniciales del país, seguido de guion bajo y del apellido), mientras que en el fichero de texto tan sólo viene el apellido.

  • En “Propiedades de campo” seleccionamos “Propiedades globales” y en prefijo añadimos “ESP_”.
  • En “Propiedades de carga de datos” asignamos esta columna a la dimensión “Vendedor”.

4.- Producto: este campo viene en el fichero de datos pero no en el Outline. En “Propiedades de carga de datos” seleccionamos “Omitir campo durante la carga de dato”.

Se nos presenta el siguiente problema: si un mismo vendedor tiene varios registros de datos (uno por cada producto) al ignorar en la carga este campo los registros van a ser coincidentes por lo que al subir los datos tan sólo se recogería uno (el último de ellos).

Ejemplo:

Como nos interesa que todos los datos de ese vendedor (de los diferentes productos) se sumen tenemos que indicar esta propiedad: que cuando encuentre un registro coincidente en lugar de sobrescribir el anterior agregue los datos:

  • En el menú “Editor de preparación de datos” -> “Configuración de carga de datos” -> “Valores de carga de datos” -> “Agregar a valores existentes”.

5.- Fecha: vamos a suponer que el formato es diferente en el Outline y en el fichero de datos:

  • Mientras que en el Outline tenemos dos dimensiones: Año y Mes, en el fichero de datos la fecha viene en un único campo con el formato DD-MM-AAAA. Por ejemplo: 23-01-2020.

En la “Regla de Carga” tenemos que dividir este campo en 3 columnas:

En el menú “Editor de preparación de datos” -> “Dividir campo”; indicamos en “Número de caracteres de una columna” 3:

  • El campo queda inicialmente dividido en 2 columnas: “23-“ y “01-2020”

La primera columna con las 3 primera posiciones (“23-“) en “Propiedades de campo” -> “Propiedades de carga de datos” seleccionamos “Omitir campo durante la carga de dato”.

En la siguiente columna “01-2020” volvemos a seleccionar “Dividir campo” e indicamos en “Número de caracteres de una columna” 3:

  • Este campo queda dividido en otras 2 columnas: “01-“ y “2020”

En la primera columna “01-“, correspondiente al mes, tenemos que realizar la siguiente conversión (vamos a suponer que en el Outline este campo viene en texto):

  • En “Propiedades de campo” -> “Propiedades globales” indicamos en “Reemplazar” / “Por”:

Tras Aceptar asignamos esta columna a la dimensión “Mes”.

La tercera columna (“2020”) la asignamos a la dimensión “Año”.

6.- Objetivo y Venta: las siguientes columnas del fichero de datos “Objetivo” y “Venta” las asignamos directamente a las dimensiones “Objetivo” y “Venta”.

Una vez asignadas todas las columnas a las dimensiones correspondientes, en el menú superior del “Editor de preparación de datos” hacemos click en “Validar” y guardamos.

  • Ya tenemos el “Archivo de reglas” preparado para la subida de datos.

Asignar una columna de datos a varias dimensiones

Al definir una regla de carga de datos es posible asignar una columna de datos a varias dimensiones.

Veamos un ejemplo: partimos de la siguiente estructura de outline y de fichero de datos:

Vamos a suponer que este fichero de datos trae exclusivamente información de un país (Francia), de una ciudad (París), de un vendedor (Pierre) y de un año (2020).

Tenemos 2 posibilidades:

a) Crear en la regla de carga 4 campos de textos con estos datos (Francia, París, Pierre, 2020) y asignarlos a estas 4 dimensiones (País, Ciudad, Vendedor, Año), tal como vimos anteriormente (tratamiento que se le dio en el punto 1 a la dimensión “País”).

b) Asignar las columnas de datos (Objetivos y Ventas) a todas las dimensiones involucradas:

  • Objetivo: Francia -> París -> Pierre -> 2020 -> Objetivo
  • Ventas: Francia -> París -> Pierre -> 2020 -> Ventas

La regla de carga de datos quedaría:

Subida de datos

  • Botón derecho sobre la base y en el desplegable seleccionamos “Cargar datos”: en la ventana que se abre seleccionamos el fichero de datos que queremos subir con la regla de datos que hemos preparado.
  • Tenemos que comprobar que la opción “Sobrescribir” esté deshabilitada para que agregue los registros coincidentes.
  • Aceptar.
Anuncio publicitario