Database Reference
In-Depth Information
The last step is to create our final set:
CREATE SET LastSaleAnalysisPeriod AS
{
LastSaleYear.Item (0).Lag(2) :
LastSaleYear.Item (0),
LastSaleMonth.Item (0).PrevMember,
LastSaleMonth.Item (0)
};
Now that the set has been created, the user will be able to select the set in their client
tool and use it in their report very easily:
Named sets are evaluated and created every time the cube is processed, so as a result
whenever a new month with sales appears in the data, the set will reflect this and the
report will automatically show the required time periods when it is refreshed.
Dynamic named sets
As we've just seen, named sets are, by default, static - their contents will always stay
the same until the next time the cube is processed. This is useful in some situations,
for example, when you're trying to improve query performance, but in others it can
be quite frustrating. Imagine, for example, we wanted to define a set containing our
10 best-selling products. We can easily build it using the TopCount function:
CREATE SET Best10Products AS
TopCount (
Product.Product.Product.Members,
10,
Measures.[Sales Amount]
);
 
Search WWH ::




Custom Search