Reputation: 423
I'm developing a virtual cube in Pentaho Workbench (version 8.3) that combines two physical cubes:
The goal is to dynamically switch between these cubes based on the dimensions and filters selected by the analyst in Pentaho Saiku Analytics:
To achieve this, I'm creating a virtual cube and calculated members to check for selected operation-related dimensions. However, I'm facing two conflicting issues:
Here are examples of the errors I'm encountering:
The 'operation_date' dimension contains more than one hierarchy, therefore the hierarchy must be explicitly specified.
Cannot convert string 6_day to type UInt16: while executing 'FUNCTION equals(toYear(operation_date_utc_short) : 2, '6_day' : 1) -> equals(toYear(operation_date_utc_short), '6_day') UInt8 : 3'. (TYPE_MISMATCH)
I've tried two approaches, but each solves only one of the issues:
<CalculatedMember name="HasOperationDateFilter" formula="
IIF(
COUNT(EXISTING [operation_date].[1_year].Members) > 1 OR
COUNT(EXISTING [operation_date].[2_quarter].Members) > 1 OR
COUNT(EXISTING [operation_date].[3_month].Members) > 1 OR
COUNT(EXISTING [operation_date].[4_week_of_year].Members) > 1 OR
COUNT(EXISTING [operation_date].[5_day_of_week].Members) > 1 OR
COUNT(EXISTING [operation_date].[6_day].Members) > 1,
1, 0
)
" dimension="Measures" visible="false">
</CalculatedMember>
<!-- Similar members for other dimensions -->
<CalculatedMember name="HasOperationDateFilter" formula="
IIF(
COUNT(EXISTING [operation_date].Members) >
COUNT([operation_date].DefaultMember),
1, 0
)
" dimension="Measures" visible="false">
</CalculatedMember>
<!-- Similar members for other dimensions -->
How can I create calculated members that correctly detect selected operation-related dimensions/filters?
Given that these complex MDX expressions will be converted to SQL and executed on ClickHouse, am I potentially over-complicating the solution? Could the performance overhead of these MDX-to-SQL conversions negate any optimization benefits we're trying to achieve?
Upvotes: 0
Views: 58