In a cube there's an item dimension. An item - other than an item number - can also have other (numerical) attributes.
D_Item
- Attribute [attrib1]
- Element1 [70]
- Element2 [40]
- Element3 [1]
- Element4 [2]
- Other hierarchies
My goal is to use a iif or case ... when ... to create a new hierarchy (or set?) that I could use for slicing. Why not persist it into the cube? Because it is a very single use case and it is for use in a report...
My desired structure looks like this:
WITH MyNewHierarchy AS
CASE
WHEN [D_Item].[attrib].Value = 70 then 'Company 1'
WHEN [D_Item].[attrib].Value = 40 then 'Company 2'
WHEN [D_Item].[attrib].Value = 1 OR [D_Item].[attrib].Value = 2 then 'Company 3'
END
SELECT Measure ON COLUMNS,
[D_Date].[Month].Chilren on ROWS
FROM CUBE
WHERE
[MyNewHierarchy].[Company 3]
That's probably quite a relational approach but I hope to reach this result one day.