mdxactivepivot

Is there an easy alternative to DistinctCount by using an ActivePivot Post processor


I have a slow MDX query that does the following:

WITH MEMBER Measures.DistinctCode as 'DistinctCount({[CODE].Children})'
SELECT 
NON EMPTY Hierarchize({DrilldownLevel({[DATE].[ALL].[AllMember]})}) ON ROWS,
NON EMPTY Hierarchize({DrilldownLevel({[SYSTEM].[ALL].[AllMember]})}) ON COLUMNS
FROM [CUBE]
WHERE ([Measures].[DistinctCode])

How could I write a post processed measure in ActivePivot that returns the same as my Distinct Count calculated member? I imagine this would be a lot faster?

Thanks


Solution

  • Have you looked at the LeafCountPostProcessor that ships out of the box in the open-source activepivot-ext artifact?

    com.quartetfs.biz.pivot.postprocessing.impl.LeafCountPostProcessor