Reputation: 81
Here's my problem: I have an SSAS cube for multiple production companies. Company data is part of the "machine" dimension:
[Machine].[Company code]
Then I have two measures:
[Measures].[OEE] and [Measures].[OEE for company X]
In this case, I have to use the second measure for company X and the first measure for all other companies.
Is there a way to make a single measure which would display one measure for company X and another measure for other companies?
Upvotes: 0
Views: 77
Reputation: 1515
Several scenarios are possible (based on sources, underlying logic etc.)
For physical measures based on columns. Create calculated column in Data Source View with T-SQL: case when {company X} then {column for this company} else {columns for other companies} end
. Use it as a physical measure in cube.
For both physical and calculated measures. Hide existing measures, create new calculated measure with MDX: IIF([Machine].[Company code].CurrentMember is [Machine].[Company code].&[X],[Measures].[OEE for company X],[Measures].[OEE])
.
If only [OEE] name is allowed for both. Rename existing [OEE], hide both, create new calculated measure as [Measures].[OEE] as IIF([Machine].[Company code].CurrentMember is...
from #2 above.
Use SCOPE statement. SCOPE([Machine].[Company code].&[X],[Measures].[OEE]);
THIS=[Measures].[OEE for company X];
END SCOPE;
Use direct way: ([Machine].[Company code].&[X],[Measures].[OEE])=[Measures].[OEE for company X];
Please use any of these or update your question with more details.
Upvotes: 2