When using multi-dimensional data for analysis, we usually need to take these multi-dimensional data offline for processing or demonstration, which requires the use of the cub file, so how to generate the cub file becomes the key, I recently used this for a small project and read an example in msdn. I feel that it is not detailed enough. So I will provide you with a simple MDX statement I wrote:
Create Global cube [teststudy1]
Storage 'C: \ localstudy. cub'
From [test]
(
Measure [test]. [score],
Dimension [test]. [time],
Dimension [test]. [Student]
)
The create glogbal cube statement is unnecessary,
Teststudy1 is the name of the new cube to be created,
C: \ localstudy. cub is the name and path of the multi-dimensional dataset to be created.
Test is the name of the new cube.
The following measure is the measurement value in the newly created cube.
Dimesion is based on those dimensions. This is just a simple example. Here is an answer provided by Tim Peterson on the msdn Forum, hoping to help you.
We create as2005 local cube files programmatically in cubeslice like this:
1. We use the AMO scripter to generate a create assl script for the database.
2. We manipulate the script in a number of ways:
Removing unwanted cubes, dimensions, levels, measures, and other objects.
Slicing on particle members, if desired.
Switching to an Analysis Server Source, if desired.
Manipulating the performanceview to reduce the size of the local cube, if desired.
Specified lidating partitions, if necessary.
Taking care of other issues.
Batching the create script together with a process script.
3. We then use an adomd cellset to create the local cube. The assl script is assigned as the source of the cellset. When the cellset is opened the local cube is created.
There are a lot of things that need to be considered when creating local cube files. if you can use the script generated from the scripter without modifications, it's not too difficult. if you want to minimize the size of your local cubes (which improves browsing performance) There's more work involved. we're re trying to provide the choices to make it easy with our product, cubeslice 9 (now in Beta ). we allow local cube creation to be scheduled using a command and parameters. we do not (not yet at least) provide an API to call our product.
We haven't fully enough ented all the ways we manipulate the assl script in creating the local cube. Our product exposes the script we use, so that you can examine how individual situations can be handled.
Tim Peterson