Cube Factory: Excel
Creating a cube from Excel sheets is very similar to the multi files (e.g. CSV) cube approach as described in the previous chapter. Here, each file is replaced by an Excel sheet. The working example 'Sales (Excel)' defines a cube made of dimensions and facts as defined in the file: data/sales.xls. Each sheet contains a header line as defined in the file version. The following image shows the sheet defining the [Geography] dimension:
Similar to the other approaches, once our Excel sheets are ready, we must create a very simple XML wrapper indicating we want to create a cube from the Excel sheets and to register this cube within the icCube server. Here is the cube factory for the working example 'Sales (Excel)':
<cubeBasedSchemaFactory xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.crazy-development.com/schemas/icSchemaFactory.xsd"> <schemaName>Sales (Excel)</schemaName> <schemaDescription>A schema example defining a single cube built from Excel sheets.</schemaDescription> <schemaGroup>Examples</schemaGroup> <cubeFactories> <excelCubeFactory> <cubeName>Sales</cubeName> <excelFileName>data/sales.xls</excelFileName> </excelCubeFactory> </cubeFactories> </cubeBasedSchemaFactory>
In the chapter 'XML Schema Definition: Mixed (File + Excel)' you'll see how to explicitly select which sheets and columns to use for a given dimension definition.
Next chapter: Recap briefly describes each step for creating a cube using a cube factory as described in this section.