go to post Nick Petrocelli · Nov 14, 2023 I got an answer to this question internally and am reposting it here. From Daniel Bissex: Using the MDX COUNT function is the slower of two options. We also have a provided Distinct plugin to address exactly this inefficiency:https://docs.intersystems.com/iris20231/csp/documatic/%25CSP.Documatic.cls?LIBRARY=%25SYS&PRIVATE=1&CLASSNAME=%25DeepSee.PlugIn.Distinct This uses our %KPI() function syntax, more detailed description of the calling options can be found here:https://docs.intersystems.com/iris20231/csp/docbook/Doc.View.cls?KEY=D2RMDX_percentK This reduced the runtime from ~5 minutes to about two seconds! The linked documentation is for IRIS 2023.1, but these functions are available in 2022.1 as well.
go to post Nick Petrocelli · Nov 14, 2023 I actually already have the calculated measures defined in the cube itself and not in the pivot table - apologies for being unclear.