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 » Thu Dec 05, 2013 1:36 pm

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: 445
Joined: Sun May 11, 2008 7:07 pm
OLAP Product: TM1, MSAS
Version: Anything thru 11.x
Excel Version: 2003 - 2016
Location: Alabama, USA
Contact:

Re: Mdx expression with comment (really ?)

Post by Mike Cowie » Thu Dec 05, 2013 2:23 pm

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

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 » Thu Dec 05, 2013 3:03 pm

Wise words.

Cheers Mike.
Certified IBM Cognos TM1 Developer @ Aexis

Wim Gielis
MVP
Posts: 2287
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1
Version: PAL 2.0.8
Excel Version: Office 365 - latest
Location: Brussels, Belgium
Contact:

Re: Mdx expression with comment (really ?)

Post by Wim Gielis » Thu Dec 05, 2013 3:11 pm

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

Excel Most Valuable Professional, 2011-2014
http://www.wimgielis.com ==> 109 TM1 articles and a lot of custom code
Newest blog article: Set up a TM1 model with AutoHotKey as a service or application

User avatar
Mike Cowie
Site Admin
Posts: 445
Joined: Sun May 11, 2008 7:07 pm
OLAP Product: TM1, MSAS
Version: Anything thru 11.x
Excel Version: 2003 - 2016
Location: Alabama, USA
Contact:

Re: Mdx expression with comment (really ?)

Post by Mike Cowie » Thu Dec 05, 2013 7:43 pm

Wim:

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

Regards,
Mike

Post Reply