@@ -727,18 +727,29 @@ export class PreAggregations {
727727 }
728728 }
729729
730- // In 'rollupJoin' / 'rollupLambda' pre-aggregations fullName members will be empty, because there are
731- // no connections in the joinTree between cubes from different datasources
732- const dimsToMatch = references . rollups . length > 0 ? references . dimensions : references . fullNameDimensions ;
733-
734- const dimensionsMatch = ( dimensions , doBackAlias ) => {
735- const target = doBackAlias ? backAlias ( dimsToMatch ) : dimsToMatch ;
736- return dimensions . every ( d => target . includes ( d ) ) ;
737- } ;
730+ let dimsToMatch : string [ ] ;
731+ let timeDimsToMatch : PreAggregationTimeDimensionReference [ ] ;
732+ let dimensionsMatch : ( dimensions : string [ ] , doBackAlias : boolean ) => boolean ;
733+
734+ if ( references . rollups . length > 0 ) {
735+ // In 'rollupJoin' / 'rollupLambda' pre-aggregations fullName members will be empty, because there are
736+ // no connections in the joinTree between cubes from different datasources
737+ dimsToMatch = references . dimensions ;
738+ timeDimsToMatch = references . timeDimensions ;
739+
740+ dimensionsMatch = ( dimensions , doBackAlias ) => {
741+ const target = doBackAlias ? backAlias ( dimsToMatch ) : dimsToMatch ;
742+ return dimensions . every ( d => target . includes ( d ) ) ;
743+ } ;
744+ } else {
745+ dimsToMatch = references . fullNameDimensions ;
746+ timeDimsToMatch = references . fullNameTimeDimensions ;
738747
739- // In 'rollupJoin' / 'rollupLambda' pre-aggregations fullName members will be empty, because there are
740- // no connections in the joinTree between cubes from different datasources
741- const timeDimsToMatch = references . rollups . length > 0 ? references . timeDimensions : references . fullNameTimeDimensions ;
748+ dimensionsMatch = ( dimensions , doBackAlias ) => {
749+ const target = doBackAlias ? backAlias ( dimsToMatch ) : dimsToMatch ;
750+ return dimensions . every ( d => target . includes ( d ) ) ;
751+ } ;
752+ }
742753
743754 const timeDimensionsMatch = ( timeDimensionsList , doBackAlias ) => R . allPass (
744755 timeDimensionsList . map (
0 commit comments