OLAPCubeCache
When you work with OLAP, cubes can theoretically hold huge amounts of values although they usually hold only a fraction of possible values. In most cases you can use data area functions to find these values efficiently. But because data areas provide the values in undefined order, sometimes it can be impossible to process them. For these cases, it is required to iterate through the dimension elements to ensure that the values are processed in a certain order. For larger structures this approach can be impossible, because of the huge amount of data.
To manage these cases, the OLAPCubeCache
data type was introduced, which combines the two approaches above. A cube cache uses
a data area to find all values in the specified range. But it does not process the
values nor does it remember all of them. There can still be too many values to keep
them in memory. The cube cache remembers for the dimensions to cache, whether a
value of an element is found or of a combination of elements.
With this information, you can use nested loops to iterate through the values. First, create the cube cache. Then it can be checked in every loop for a dimension, whether a value of an element and all combinations with other elements is found. If not, all nested loops can immediately be skipped.
OLAPConnection con = OLAPCreateConnection(
"server",
"user",
"password"
);
OLAPCubeCache cache = OLAPCreateCubeCache(
con,
"cube",
"dimension1",
"dimension2"
);