34
PASOS PARA EL POBLAMIENTO DE LAS TABLAS DIM_PRODUCTOS Y DIM_TIEMPOPORXCAT

PASOS PARA EL POBLAMIENTO DE LAS TABLAS DIM_PRODUCTOS Y DIM_TIEMPOPORXCAT

Embed Size (px)

Citation preview

Page 1: PASOS PARA EL POBLAMIENTO DE LAS TABLAS DIM_PRODUCTOS Y DIM_TIEMPOPORXCAT

PASOS PARA EL POBLAMIENTO DE LAS TABLAS DIM_PRODUCTOS Y DIM_TIEMPOPORXCAT

Page 2: PASOS PARA EL POBLAMIENTO DE LAS TABLAS DIM_PRODUCTOS Y DIM_TIEMPOPORXCAT

1. Se hace la creación de la DB hitvanceDW y se crean las tablas que se necesitan para el poblamiento

Page 3: PASOS PARA EL POBLAMIENTO DE LAS TABLAS DIM_PRODUCTOS Y DIM_TIEMPOPORXCAT

2. Se crea el Proyecto utilizando SQL Server Data Tools y se crean las dimensiones para su respectivo poblamiento.

Page 4: PASOS PARA EL POBLAMIENTO DE LAS TABLAS DIM_PRODUCTOS Y DIM_TIEMPOPORXCAT

3. Se da doble Clic en DimensionProducto y luego se crean los orígenes ProductoOLTP y Producto OLAP

Page 5: PASOS PARA EL POBLAMIENTO DE LAS TABLAS DIM_PRODUCTOS Y DIM_TIEMPOPORXCAT

4. Ahora se crea una Nueva Conexión de la DB Origen dándole clic en el botón Nueva.. se Prueba la conexión y si es exitosa seguir adelante.

Page 6: PASOS PARA EL POBLAMIENTO DE LAS TABLAS DIM_PRODUCTOS Y DIM_TIEMPOPORXCAT

5. Ya con la Conexión correcta se elije la DB de Origen de datos (Hitvance) y en Modo de Acceso a Datos se elije Comando SQL y se crea la consulta y aceptamos

Page 7: PASOS PARA EL POBLAMIENTO DE LAS TABLAS DIM_PRODUCTOS Y DIM_TIEMPOPORXCAT

6. Realizamos lo mismo se crea una Nueva Conexión de la DB Destino dándole clic en el botón Nueva.. se Prueba la conexión y si es exitosa seguir adelante.

Page 8: PASOS PARA EL POBLAMIENTO DE LAS TABLAS DIM_PRODUCTOS Y DIM_TIEMPOPORXCAT

7. Ahora elegimos la DB hitvanceDW donde se almacenarán los datos y en Modo de Acceso a datos elegimos Tabla o Vista y elegimos la Tabla Dim_Productos

Page 9: PASOS PARA EL POBLAMIENTO DE LAS TABLAS DIM_PRODUCTOS Y DIM_TIEMPOPORXCAT

8. Ya habiendo elegido la DB y sus tablas a utilizar tanto en OLTP y OLAP utilizamos la herramienta Ordenar y le damos clic a la flecha azul de los orígenes y jalamos para conectar tanto los Orígenes con el Ordenar

Page 10: PASOS PARA EL POBLAMIENTO DE LAS TABLAS DIM_PRODUCTOS Y DIM_TIEMPOPORXCAT

9. Le damos Doble Clic en OrdenarOLTP y se abrirá el editor de transformación ordenar y elegimos la llave primaria de la tabla Producto (CodProd)

Page 11: PASOS PARA EL POBLAMIENTO DE LAS TABLAS DIM_PRODUCTOS Y DIM_TIEMPOPORXCAT

10. Lo mismo en Ordenar OLAP solo que ahora elegimos también de la tabla Dim_Producto (CodProd)

Page 12: PASOS PARA EL POBLAMIENTO DE LAS TABLAS DIM_PRODUCTOS Y DIM_TIEMPOPORXCAT

11. Primero agregamos la herramienta Combinación de Mezcla y Unimos Ordenar OLTP a Combinación de Mezclas se abre un cuadro y en Entrada elegimos la opción (Entrada izquierda de combinación de mezcla)

Page 13: PASOS PARA EL POBLAMIENTO DE LAS TABLAS DIM_PRODUCTOS Y DIM_TIEMPOPORXCAT

12. Lo mismo para Ordenar OLAP solo que esta vez al unir ya no aparece un cuadro por lo que predeterminadamente elije la opción (Entrada Derecha de Combinación de Mezclas)

Page 14: PASOS PARA EL POBLAMIENTO DE LAS TABLAS DIM_PRODUCTOS Y DIM_TIEMPOPORXCAT

16. Ahora al hacerle Clic en Combinación de Mezcla se abre este cuadro y en la parte tipo de combinación se elige la opción Combinación Externa Completa y se eligen los campos en OLTP (todos) y OLAP(todos menos KeyProducto) y en la parte de abajo se cambian los nombres agregándole DW solo en OLAP

Page 15: PASOS PARA EL POBLAMIENTO DE LAS TABLAS DIM_PRODUCTOS Y DIM_TIEMPOPORXCAT

14. Ahora agregamos la herramienta División Condicional y al darle doble Clic se abre Editor de transformación DC y se hará las condiciones tanto para datos Nuevos y Datos Actualizados

Page 16: PASOS PARA EL POBLAMIENTO DE LAS TABLAS DIM_PRODUCTOS Y DIM_TIEMPOPORXCAT

15. Se agregan las herramientas Destino de OLE DB para datos Nuevos y Comando de Ole DB para datos actualizados y al unir la División Condicional se abre esta cuadro donde en Salida elegimos cual es la salida si Solo Nuevos o Solo Actualizados

Page 17: PASOS PARA EL POBLAMIENTO DE LAS TABLAS DIM_PRODUCTOS Y DIM_TIEMPOPORXCAT

16. Damos doble Clic en Destino OLE DB y sale esta ventana donde elegimos la DB hitvanceDW donde se almacenaran los datos elegimos la tabla en este caso Productos y en asignaciones unimos campo por campo execto el KeyProducto de la tabla destino.

Page 18: PASOS PARA EL POBLAMIENTO DE LAS TABLAS DIM_PRODUCTOS Y DIM_TIEMPOPORXCAT

17. Ahora lo mismo para Comando de OLE DB damos doble Clic y se abre esta ventana elegimos la DB Destino hitvanceDW

Page 19: PASOS PARA EL POBLAMIENTO DE LAS TABLAS DIM_PRODUCTOS Y DIM_TIEMPOPORXCAT

18. Ahora en la ficha Propiedad de Componentes vamos a donde dice SqlCommand y al estremo le damos clic y se abrirá esta ventana donde colocaremos la consulta para actualizar datos

Page 20: PASOS PARA EL POBLAMIENTO DE LAS TABLAS DIM_PRODUCTOS Y DIM_TIEMPOPORXCAT

19. Ahora en la ficha asignación de columnas elegimos como hemos hecho en la consulta update para asignar los parámetros correctamente con el CodProd al final por ser el ultimo parámetro.

Page 21: PASOS PARA EL POBLAMIENTO DE LAS TABLAS DIM_PRODUCTOS Y DIM_TIEMPOPORXCAT

20. Se ejecuta y deben aparecer como en la imagen todo correcto y si se dan cuenta por ser nuevos datos solo la fila Solo Nuevos tiene datos en este caso 815 Filas, Nuevamente e ejecutado pero e hecho cambios en la tabla productos y solo se ven las filas actualizadas.

Page 22: PASOS PARA EL POBLAMIENTO DE LAS TABLAS DIM_PRODUCTOS Y DIM_TIEMPOPORXCAT

21. Aquí la DB hitvanceDW y su tabla Dim_Productos con datos llenos sus 815 Filas

Page 23: PASOS PARA EL POBLAMIENTO DE LAS TABLAS DIM_PRODUCTOS Y DIM_TIEMPOPORXCAT

1. Le damos Doble Clic en Dimensión tiempo y se agregan las herramientas Origen de OLE DB y agregamos dos un OLTP y un OLAP.

Page 24: PASOS PARA EL POBLAMIENTO DE LAS TABLAS DIM_PRODUCTOS Y DIM_TIEMPOPORXCAT

2. Al darle clic en tiempo OLTP elegimos la DB de origen hitvance y ponemos el comando SQL.

Page 25: PASOS PARA EL POBLAMIENTO DE LAS TABLAS DIM_PRODUCTOS Y DIM_TIEMPOPORXCAT

3. Lo mismo en Tiempo OLAP solo que ahora elegimos la DB hitvanceDW y elegimos la tabla o vista Dim_TimepoProxCat

Page 26: PASOS PARA EL POBLAMIENTO DE LAS TABLAS DIM_PRODUCTOS Y DIM_TIEMPOPORXCAT

4. Juntamos las tablas Origen con Ordenar para cada una y unirlas con la flecha azul.

Page 27: PASOS PARA EL POBLAMIENTO DE LAS TABLAS DIM_PRODUCTOS Y DIM_TIEMPOPORXCAT

5. Ahora le damos doble Clic a ordenar OLTP y se abrirá la siguiente ventana donde elegiremos el campo Date será como principal y lo mismo para Ordenar OLAP pero elegiremos Fecha como principal.

Page 28: PASOS PARA EL POBLAMIENTO DE LAS TABLAS DIM_PRODUCTOS Y DIM_TIEMPOPORXCAT

6. Ahora utilizamos la herramienta Combinación de Mezclas y al unir el Ordenar OLTP sale este cuadro donde escogeremos la entrada Izquierda de Combinación de Mezclas, igual para Ordenar OLAP solo que este escoge predeterminado Entrada derecha de combinación de mezcla

Page 29: PASOS PARA EL POBLAMIENTO DE LAS TABLAS DIM_PRODUCTOS Y DIM_TIEMPOPORXCAT

7. Al darle doble Clic en Combinación de mezclas se elige la opción Combinación externa Completa en orden tanto de OLTP como OLAP y se elige en orden cuadro por cuadro y abajo en donde dice Ordenar OLAP por orden seria mejor agregar el DW después de cada nombre de campo.

Page 30: PASOS PARA EL POBLAMIENTO DE LAS TABLAS DIM_PRODUCTOS Y DIM_TIEMPOPORXCAT

8. Se agrega la herramienta División Condicional y al darle doble clic en este caso por ser fechas solo hay ingreso de datos y no modificación.

Page 31: PASOS PARA EL POBLAMIENTO DE LAS TABLAS DIM_PRODUCTOS Y DIM_TIEMPOPORXCAT

9. Se agrega la herramienta Destino de OLE DB y se da doble clic y se abre el cuadro donde elegiremos la base de datos destino hitvanceDW y se elije la tabla Dim_tiempoProdxCat.

Page 32: PASOS PARA EL POBLAMIENTO DE LAS TABLAS DIM_PRODUCTOS Y DIM_TIEMPOPORXCAT

10. Ahora en asignaciones se asigna cada dato desde su origen menos el KeyTiempo por ser auto incrementable.

Page 33: PASOS PARA EL POBLAMIENTO DE LAS TABLAS DIM_PRODUCTOS Y DIM_TIEMPOPORXCAT

11. Se ejecuta y se observa que se han agregado las 185 filas a la DB hitvanceDW tabla Dim_tiempoProxCat

Page 34: PASOS PARA EL POBLAMIENTO DE LAS TABLAS DIM_PRODUCTOS Y DIM_TIEMPOPORXCAT

12. Aquí la tabla Dim_tiempoProXcat con sus datos respectivos las 185 filas.