Quantcast
Channel: SQLServerCentral » Data Warehousing » Analysis Services » Latest topics
Viewing all articles
Browse latest Browse all 1341

Calculations Filter

$
0
0
Ive been tasked with converting a collection of tables with SQL scripts into an SSAS cube with calculations, Im having a problem filtering the data in a way that I would find straightforward in SQL. An example of what I would like to do is to take data such as this:Category RegionBikes EUBikes EUBikes USAParts USAParts USAAccessories USAAccessories GBAccessories EUInto the following:Category RegionBikes EUBikes EUAccessories USAAccessories GBIn SQL I would do something like placing the following in the Where part of the script: WHERE (Category = 'Bikes' AND Region = 'EU) OR (Category = 'Accessories' AND Region NOT 'EU')Ive been trying to replicate this in a calculated member, whilst I find it easy to filter by region OR Category, I find it difficult to combine the two. Here is part of my filter in the calculated member:{[Vw Dim Parts].[Category].&[Bikes],[Vw Dim Parts].[Category].&[Accessories]}This filters for the category and accessories fine but when I do something like the following it throws an error:{([Vw Dim Parts].[Category].&[Bikes] AND [Vw Dim Area].[Region].&[EU],[Vw Dim Parts].[Category].&[Accessories] NOT [Vw Dim Area].[Region].&[EU]}I don't know the exact syntax to replace the AND and NOT, when I try to process I get an error saying that members tuples and sets must use the same hierarchies.Does anyone know how I can replicate the logic from SQL in SSAS calculated members? Thanks.

Viewing all articles
Browse latest Browse all 1341

Trending Articles