@XREF

English (Español a continuación)

This function allows connecting an ASO database with a BSO database, copying the data from the 1st to the 2nd, both level 0 values and aggregated levels values.

Advantages of this connection:

  • Flexibility: allows to map accurately the sections of the source and target databases, even in those cases in which theirs dimensions do not coincide, or when the members have different names / aliases.
    • More flexible than copying the data through an export or report script.
  • Transmission speed: although it will depend on the volume of the transmission, it is usually very fast.

This connection requires the following steps:

a) Connect the databases: right-click on the target database, select «Edit / Location aliases», select the source database, and in the «Alias» section select the name which will be used in the @XREF function to identify this database.

b) This function is included in a calc script in the target database, determining which section of the source database we want to copy and in which section of the target database will be loaded this data.

  • These 2 sections (source and target) must have the same number of cells. If they have different dimensions, a mapping must be done to achieve equality in the size of the two sections.

Normally this function is included in a FIX, which determines the section of the target database in which we will load the data.

  • FIX(…)
    • Block opening(
    • @XREF(ALIAS, …;)
    • )
  • ENDFIX

a) FIX: all the dimensions of the target database must be identified, specifying in each of them the section in which we want to load the data.

  • One of the dimensions may not be included in the FIX and used to open blocks.

b) Block opening: We use the member of one dimension of the target database to open the blocks to load the data.

c) @XREF: It begins with the alias chosen to identify the source database, followed by those dimensions of this database that do not match those of the target database.

  • The coincident dimensions, already included in the FIX, must not be included in the @XREF.
    • For example, if we want to copy the data of the different months (January to December), and this dimension exists in both databases with the same members, we will include this dimension in the FIX “@RELATIVE(Months ,0)”, but we do not need to repeat it in the @XREF.

This function requires mapping those dimensions that are in one database but not in the other, or when their members have different names / aliases.

Let’s look at different examples:

a) If the two databases have the dimension «Months», but their members have different names (for example, «Jan» in the source database and «January» in the target database), this mapping must be done:

  • We can open a FIX for each month:
    • FIX( … )
      • FIX(January)
        • Block opening(@XREF(Alias,Jan,…);)
      • ENDFIX
      • FIX(February)
        • Block opening(@XREF(Alias,Feb,…);)
      • ENDFIX
    • ENDFIX
  • We can also use the members of this dimension «Months» to open the blocks:
    • FIX( … )
      • January(@XREF(Alias,Jan,…);)
      • February(@XREF(Alias,Feb,…);)
    • ENDFIX

b) If one dimension exists in the target database but does not exist in the source database, this dimension has to be included in the FIX.

  • Attention: only one member of this dimension in which we will load the data.

For example, suppose two dimensions «Years» and «Months»: both exist in the target database while in the source database only the dimension «Years»: these two dimensions must be included in the FIX, but we will include only one member of the dimension » Months» (for example, «December») in which we will load the data.

  • We can also use “December” as the member for the opening of blocks.

c) Conversely, if a dimension exists in the source database but not in the target database, we will have to include this dimension in the @XREF but not in the FIX.

  • We will have to select a single member of this dimension (either the dimension itself, or a member that aggregates the data that we want to copy in the target database).

For example, following the previous example: suppose the two dimensions «Years» and «Months» in the source data base, and only the dimension «Years» in the target database: the dimension «Months» must be included in the @XREF:

  • @XREF(Alias,Months…)

Attention:

  • If one specific member exists in the source database but not in the target database, and it is not excluded in the mapping: it is not a problem (the data of this member is not transmitted).
  • But if one specific member exists in the target database and not in the source database, and it is not excluded in the mapping: an ERROR occurs since this member will be loaded with the data corresponding to the total of that dimension.

Let’s see different examples: We have two databases:

  • Source database (ASO): «Sales»
  • Target database (BSO): «Markets»

We connect these two databases using the alias «DB_Sales»

We want to copy all the data corresponding to the year 2020:

a) The two databases are coincident:

  • FIX(@RELATIVE(“Months”,0), @RELATIVE(“Products”,0), @RELATIVE(“Sellers”,0), @RELATIVE(“Data”,0))
    • “2020”(
    • @XREF(BD_Sales);
    • )
  • ENDFIX

b) The two databases have the same dimensions but the members differ:

  • FIX(“2020”,@RELATIVE(“Months”,0), @RELATIVE(“Products”,0), @RELATIVE(“Sellers”,0))
    • Sales(@XREF(DB_Sales,Incomes);)
    • Margin(@XREF(DB_Sales,Incomes) – @XREF(DB_Sales,Expenses);)
    • Profits(@XREF(DB_Sales,Incomes) – @XREF(DB_Sales,Expenses) – @XREF(DB_Sales,»Other expenses«);)
  • ENDFIX

c) The source database has more dimensions:

  • FIX(@RELATIVE(“Months”,0), @RELATIVE(“Products”,0), @RELATIVE(“Sellers”,0), @RELATIVE(“Data”,0))
    • “2020”(
    • @XREF(DB_Sales,Markets);
    • )
  • ENDFIX

d) The target database has more dimensions:

  • FIX(@RELATIVE(“Months”,0), @RELATIVE(“Products”,0), Others,@RELATIVE(“Sellers”,0), @RELATIVE(“Data”,0))
    • “2020”(
    • @XREF(DB_Sales);
    • )
  • ENDFIX

We have selected «Others», member of the «Markets» dimension (which does not exist in the source database), to load the data.

e) Different dimensions in the two databases, and different members in the same dimension:

  • FIX(“2020”,@RELATIVE(“Months”,0), @RELATIVE(“Products”,0), Others,@RELATIVE(“Sellers”,0))
    • Sales(@XREF(DB_Sales,Incomes,Currencies);)
    • Margin(@XREF(BD_Sales,Incomes,Currencies) – @XREF(BD_Sales,Expenses,Currencies);)
    • Profit(@XREF(BD_Sales,Incomes,Currencies) – @XREF(BD_Sales,Expenses,Currencies) – @XREF(BD_Sales,»Other Expenses»,Currencies);)
  • ENDFIX

Any questions, please send an email to: essbaseeasy@gmail.com

Español

Esta función permite conectar una base ASO con una base BSO, llevando los datos de la 1ª a la 2ª, tanto de nivel cero como de niveles agregados.

Ventajas de esta conexión:

  • Flexibilidad: permite mapear con total exactitud las secciones de las bases origen y destino que queremos conectar, incluso en aquellos supuestos en los que las dimensiones de las dos bases no sean coincidentes, o aún siendo coincidentes los miembros tengan distintos nombres / alias.
    • Más flexible que llevar la información con una exportación o a través de un report script.
  • Velocidad de la transmisión: aunque dependerá del volumen de la transmisión, normalmente es muy rápida.

Esta conexión requiere los siguientes pasos:

a) Conectar las bases: se hace click con el botón derecho sobre la base destino, se selecciona “Editar / Alias de ubicación”, se selecciona la base origen con la que se quiere conectar y en el apartado “Alias” se selecciona el nombre que se utilizará en la función @XREF para identificar esta base origen.

b) Se incluye en un calc script en la base destino esta función, determinando que sección de la base origen queremos traer y en qué sección de la base destino vamos a cargar estos datos.

  • Estas dos secciones (origen y destino) tienen que tener el mismo número de celdas. Si tienen distintas dimensiones hay que realizar un mapeo para lograr la igualdad en el tamaño de las dos secciones.

Normalmente esta función se incluye en un FIX, que determina la sección de la base destino en la que cargaremos la información.

  • FIX( … )
    • Apertura de bloque(
    • @XREF(ALIAS, …;)
    • )
  • ENDFIX

a) FIX: tienen que ir identificadas todas las dimensiones de la base destino, especificando en cada una de ellas la amplitud de la sección en la que queremos cargar la información de la base origen ASO.

  • Una de las dimensiones puede no incluirse en el FIX y utilizarla para la apertura de bloques.

b) Apertura de bloque: Utilizamos un miembro de una dimensión de la base destino para abrir los bloques para realizar la carga de datos.

c) @XREF: Comienza con el alias con el que hemos identificado la base origen al realizar la conexión, seguidas de aquellas dimensiones de la base origen que no coincidan con las de la base destino.

  • Aquellas dimensiones que sean coincidentes (tanto la dimensión como sus miembros) que ya estén incluidas en el FIX no hay que incluirlas en el @XREF.
    • Por ejemplo, si llevamos los datos de todos los meses del año (enero a diciembre), y esta dimensión existe con la misma denominación en la base origen y en la destino, tendremos que incluir esta dimensión en el FIX “@RELATIVE(Meses,0)”, pero no habrá que repetirla en el @XREF.

Esta función requiere mapear aquellas dimensiones que estén en una base y no en la otra, o cuando sus miembros tengan distintos nombres / alias.

Veamos diferentes ejemplos:

a) Si las dos bases tienen la dimensión “Meses”, pero sus miembros tienen distinta denominación (por ejemplo, “Ene” en la base origen y “Enero” en la base destino) hay que realizar este mapeo_

  • Podemos abrir un FIX para cada mes:
    • FIX( … )
      • FIX(Enero)
        • Apertura de bloque(@XREF(Alias,Ene,…);)
      • ENDFIX
      • FIX(Febrero)
        • Apertura de bloque(@XREF(Alias,Feb,…);)
      • ENDFIX
    • ENDFIX
  • También podemos utilizar los miembros de esta dimensión “Meses” para la apertura de los bloques:
    • FIX( … )
      • Enero(@XREF(Alias,Ene,…);)
      • Febrero(@XREF(Alias,Feb,…);)
    • ENDFIX

b) Si una dimensión existe en la base destino pero no existe en la base origen, esta dimensión se incluirá en el FIX.

  • Atención: tan sólo se puede incluir un miembro de la base destino en el que cargaremos los datos.

Por ejemplo, supongamos dos dimensiones “Años” y “Meses”: las dos existen en la base destino mientras que en la base origen tan sólo existe “Años”: estas dos dimensiones tienen que ir recogidas en el FIX, pero de la dimensión “Meses” tan sólo podemos incluir un miembro (por ejemplo, “Diciembre”) en el que cargaremos los datos de la base origen.

  • También podemos utilizar “Diciembre” como miembro para la apertura de bloques.

c) Por el contrario, si una dimensión existe en la base origen pero no en la base destino, tendremos que incluir esta dimensión en el cuerpo @XREF pero no en el FIX.

  • Tendremos que seleccionar un solo miembro de esta dimensión de la base origen (bien la propia dimensión, o un miembro que recoja los datos agregados que queremos llevar a la base destino).

Por ejemplo, siguiendo el ejemplo anterior: supongamos dos dimensiones “Años” y “Meses”: en la base destino tan sólo existe la dimensión “Años”, mientras que en la base origen tenemos estas 2 dimensiones: la dimensión “Meses” tendrá que ir recogida en el @XREF:

  • @XREF(Alias,Meses…)

Precaución:

  • Si un miembro existe en la base origen pero no en la base destino y no se ha excluido en el mapeo: NO origina problemas (la información de este miembro no se transmite).
  • Pero si un miembro existe en la base destino y no en la base origen y no se ha excluido en el mapeo genera un ERROR: Ya que en este miembro se cargará el dato correspondiente al total de esa dimensión.

Veamos diferentes ejemplos: Tenemos 2 bases de datos:

  • Base origen ASO: “Ventas”
  • Base destino BSO: “Mercados”

Conectamos estas dos bases utilizando el alias “BD_Ventas”

Queremos llevar toda la información del año 2020 de la base origen (ASO) a la base destino (BSO):

a) Las dos bases son coincidentes:

  • FIX(@RELATIVE(“Meses”,0), @RELATIVE(“Productos”,0), @RELATIVE(“Vendedores”,0), @RELATIVE(“Datos”,0))
    • “2020”(
    • @XREF(BD_Ventas);
    • )
  • ENDFIX

b) Las dos bases tienen las mismas dimensiones pero difieren los miembros:

  • FIX(“2020”,@RELATIVE(“Meses”,0), @RELATIVE(“Productos”,0), @RELATIVE(“Vendedores”,0))
    • Ventas(@XREF(BD_Ventas,Ingresos);)
    • Margen(@XREF(BD_Ventas,Ingresos) – @XREF(BD_Ventas,Gastos);)
    • Beneficio(@XREF(BD_Ventas,Ingresos) – @XREF(BD_Ventas,Gastos) – @XREF(BD_Ventas,”Otros gastos”);)
  • ENDFIX

c) Hay más dimensiones en la base origen:

  • FIX(@RELATIVE(“Meses”,0), @RELATIVE(“Productos”,0), @RELATIVE(“Vendedores”,0), @RELATIVE(“Datos”,0))
    • “2020”(
    • @XREF(BD_Ventas,Mercados);
    • )
  • ENDFIX

d) Hay más dimensiones en la base destino:

  • FIX(@RELATIVE(“Meses”,0), @RELATIVE(“Productos”,0), Otros,@RELATIVE(“Vendedores”,0), @RELATIVE(“Datos”,0))
    • “2020”(
    • @XREF(BD_Ventas);
    • )
  • ENDFIX

Hemos seleccionado el miembro “Otros”, de la dimensión “Mercados” (que no existe en la base origen), para cargar los datos.

e) Distintas dimensiones en las dos bases, y miembros diferentes en dimensiones coincidentes:

  • FIX(“2020”,@RELATIVE(“Meses”,0), @RELATIVE(“Productos”,0), Otros,@RELATIVE(“Vendedores”,0))
    • Ventas(@XREF(BD_Ventas,Ingresos,Divisas);)
    • Margen(@XREF(BD_Ventas,Ingresos,Divisas) – @XREF(BD_Ventas,Gastos,Divisas);)
    • Beneficio(@XREF(BD_Ventas,Ingresos,Divisas) – @XREF(BD_Ventas,Gastos,Divisas) – @XREF(BD_Ventas,”Otros gastos”,Divisas);)
  • ENDFIX

Cualquier consulta envía, por favor, un correo a: essbaseeasy@gmail.com

Anuncio publicitario