· Jan 5, 2021

Does %TIMERANGE MDX extended function create a set of members or a single member?

The documentation says that the MDX extended function %TIMERANGE returns a member.

However it seems like it produces a set of time members from the description ("a range of members").  Perhaps behind the scenes it is making a calculated member?  I am able to plug the return "value" from %TIMERANGE into the SUM function, which takes a set as an argument, and I get a correct answer.  So SUM((%TIMERANGE(...)) works, however COUNT(%TIMERANGE(...)) does not work and returns a cryptic error:

Should we be able to use %TIMERANGE as a set argument to any mdx function that takes a set argument?

Product version: IRIS 2020.1
Discussion (2)1
Log in or sign up to continue

Hi Lee,

The "range" language may be a bit confusing, so to be clear - %TIMERANGE() returns a single member expression.

I'm on a different version, but COUNT(%TIMERANGE(...)) appears to work for me, and it returns 1 (which is expected because %TIMERANGE() returns a single member). In general, member expressions like the result of %TIMERANGE() can also be interpreted as set expressions containing a single item, so I would expect COUNT(%TIMERANGE(...)) and the like to be valid MDX.

I'd suggest opening a WRC issue for this as well - it's great to post questions like this on the Developer Community when you're uncertain about the expected behavior, but once we've determined that the behavior you're seeing is unexpected, there is more that we can do to investigate and help you in the context of a support issue.