Good DayMy situation is that the script below is for a calculated member but I need to add a condition into that only makes the else statement apply to the current month only. All other months (the Average LIS) needs to be used as in [Measures].[Disconnects] / [AVERAGELIS][code="sql"]CREATE MEMBER CURRENTCUBE.[Measures].CHURN AS CASE WHEN [Measures].[End LIS] = 0 THENCASE WHEN [Measures].[Beginning LIS] = 0 OR [Measures].[Beginning LIS] + [Measures].[Beginning LIS] + [Measures].[NETACTIVATIONS] = 0 THEN NULL ELSE ROUND([Measures].[Disconnects]/(([Measures].[Beginning LIS] + [Measures].[Beginning LIS] + [Measures].[NETACTIVATIONS])/2) * 100 ,2) ENDELSE ROUND(([Measures].[Disconnects] / [AVERAGELIS] * 100) ,2)END, NON_EMPTY_BEHAVIOR = { [Beginning LIS], [End LIS], [Disconnects] }, VISIBLE = 1 ;[/code]I tried adding something like this but I knew while typing that it wasnt correct[code="sql"]CASE WHEN [Measures].[End LIS] = 0 AND [Dim Date].[FSCL_YR].&[" + Format(now(), "yyyy") + "] AND [Dim Date].[FSCL_YM].&[" + Format(now(), "m") + "]THENCASE WHEN [Measures].[Beginning LIS] = 0 OR [Measures].[Beginning LIS] + [Measures].[Beginning LIS] + [Measures].[NETACTIVATIONS] = 0 THEN NULL ELSE ROUND([Measures].[Disconnects]/(([Measures].[Beginning LIS] + [Measures].[Beginning LIS] + [Measures].[NETACTIVATIONS])/2) * 100 ,2) ENDELSE ROUND(([Measures].[Disconnects] / [AVERAGELIS] * 100) ,2)END[/code]
↧