Mdx expression with comment (really ?)

Post Reply
Laurent.eisenhower
Posts: 2
Joined: Wed Sep 04, 2013 11:17 am
OLAP Product: TM1 / Cognos Express
Version: All the way to 10.x
Excel Version: Up to Excel 2010
Location: Brussels / Brighton

Mdx expression with comment (really ?)

Post by Laurent.eisenhower »

Just wanted to share with you what strikes me a bit like an oddity (in version 10.2) :

A MDX statement such as for ex :

Code: Select all

 {TM1SUBSETALL( [PPRS_Stores] )}
works perfectly when tested in the expression window of the subset editor (or when used in an active form active via the TM1RPTROW formula)

... but to my surprise the following expression also worked perfectly

Code: Select all

{TM1SUBSETALL( [PPRS_Stores] )} --->Any comment here
Can anyone reproduce this (or is just me and my weird model ) ?

By instinct I would * not * use this to comment my MDX expressions (or could I ?)
Certified IBM Cognos TM1 Developer @ Aexis
User avatar
Mike Cowie
Site Admin
Posts: 482
Joined: Sun May 11, 2008 7:07 pm
OLAP Product: IBM TM1/PA, SSAS, and more
Version: Anything thru 11.x
Excel Version: 2003 - Office 365
Location: Alabama, USA
Contact:

Re: Mdx expression with comment (really ?)

Post by Mike Cowie »

Hi Laurent:

I don't think IBM officially says anywhere in their MDX support documentation that they officially support the available commenting options in the MDX language, but based on what you've found it looks like they might support at least the "--" style commenting (at least in 10.2).

You can certainly check with IBM to see if this is deliberate/officially supported and, if yes, you should be fine. If not, then it's probably more of a use at your own risk sort of thing and you might be better off documenting the MDX outside of the where it's stored in TM1. I doubt it would stop working within the same version, but it would be something you'd definitely have to re-validate with each hot fix, fix pack, etc release that you install on the TM1 Server.

Regards,
Mike
Mike Cowie
QueBIT Consulting, LLC

Are you lost without Print Reports in Planning Analytics for Excel (PAfE)? Get it back today, for free, with Print Reports for IBM Planning Analytics for Excel!
Laurent.eisenhower
Posts: 2
Joined: Wed Sep 04, 2013 11:17 am
OLAP Product: TM1 / Cognos Express
Version: All the way to 10.x
Excel Version: Up to Excel 2010
Location: Brussels / Brighton

Re: Mdx expression with comment (really ?)

Post by Laurent.eisenhower »

Wise words.

Cheers Mike.
Certified IBM Cognos TM1 Developer @ Aexis
Wim Gielis
MVP
Posts: 3105
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.0.9.18
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: Mdx expression with comment (really ?)

Post by Wim Gielis »

Hello Mike

But also without those -- it seems to work.
Text after the last } is fine...

Not that this is something I would do in a TM1 model.
Best regards,

Wim Gielis

IBM Champion 2024
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
User avatar
Mike Cowie
Site Admin
Posts: 482
Joined: Sun May 11, 2008 7:07 pm
OLAP Product: IBM TM1/PA, SSAS, and more
Version: Anything thru 11.x
Excel Version: 2003 - Office 365
Location: Alabama, USA
Contact:

Re: Mdx expression with comment (really ?)

Post by Mike Cowie »

Wim:

That's a little scary/strange, but interesting... hadn't tried that before.

Regards,
Mike
Mike Cowie
QueBIT Consulting, LLC

Are you lost without Print Reports in Planning Analytics for Excel (PAfE)? Get it back today, for free, with Print Reports for IBM Planning Analytics for Excel!
Post Reply