TM1 MDX did not work in TI

Post Reply
dharav9
Posts: 72
Joined: Wed Aug 15, 2018 3:18 pm
OLAP Product: TM1
Version: 10.3
Excel Version: 2016

TM1 MDX did not work in TI

Post by dharav9 »

Hi, All

Can someone assist with following MDX to work in TI process?

sMDX = '{TM1FILTERBYPATTERN( {TM1FILTERBYLEVEL( {TM1SubsetToSet([Employee], "Dyna_Existing")}, 0)}, "*Hargrove,Chr*")}';

I placed this MDX inside the subset editor expression window and it worked. Same MDX is not working from the TI process.

Please Advise.

Thank You
Dharav
User avatar
gtonkin
MVP
Posts: 1233
Joined: Thu May 06, 2010 3:03 pm
OLAP Product: TM1
Version: Latest and greatest
Excel Version: Office 365 64-bit
Location: JHB, South Africa
Contact:

Re: TM1 MDX did not work in TI

Post by gtonkin »

Not seen this before but try replacing the , in the wildcard string with another * and see if there is perhaps something going wrong due to a comma in the string.
BR, George.

Learn something new: MDX Views
User avatar
Elessar
Community Contributor
Posts: 391
Joined: Mon Nov 21, 2011 12:33 pm
OLAP Product: PA 2
Version: 2.0.9
Excel Version: 2016
Contact:

Re: TM1 MDX did not work in TI

Post by Elessar »

Hi,

Can the subset you are using be private?
Best regards, Alexander Dvoynev

TM1 and Data Science blog: 7th article - Development requirements.
Mark RMBC
Community Contributor
Posts: 296
Joined: Tue Sep 06, 2016 7:55 am
OLAP Product: TM1
Version: 10.1.1
Excel Version: Excel 2010

Re: TM1 MDX did not work in TI

Post by Mark RMBC »

Hi,

If the advise above does not work:

I wonder if you are running into the same issue I had here:

viewtopic.php?t=15087

This is an issue with FilterByPattern picking up an alias, which I presume is what Hargrove,Chr is? This was an issue with PAX, so never tested with a TI.

My workaround was to use Instr, so something like:

{FILTER({TM1FILTERBYLEVEL( TM1SubsetToSet([Employee], "Dyna_Existing"),0)}, INSTR([Employee].[AliasName], "Hargrove,Chr") <>0)}

Please note that Instr is case sensitive, so if you cannot be sure of the case then you may need to create another alias, which is all upper or all lower and make the Instr use Lcase or Ucase. Also note that Instr will check for spaces!

regards,

Mark
lotsaram
MVP
Posts: 3683
Joined: Fri Mar 13, 2009 11:14 am
OLAP Product: TableManager1
Version: PA 2.0.x
Excel Version: Office 365
Location: Switzerland

Re: TM1 MDX did not work in TI

Post by lotsaram »

I think Mark RMBC correctly identified the issue. TM1FilterByPattern acts on the alias assigned to the subset. So if the wildcard searc on "*Hargrove,Chr*" relies on an alias then that is the reason.

For something that will ALWAYS work then you need to get the attribute value with CurrentMember.Properties("attributeName") and INSTR which is the equivalent of SCAN in MDX.
Please place all requests for help in a public thread. I will not answer PMs requesting assistance.
Mark RMBC
Community Contributor
Posts: 296
Joined: Tue Sep 06, 2016 7:55 am
OLAP Product: TM1
Version: 10.1.1
Excel Version: Excel 2010

Re: TM1 MDX did not work in TI

Post by Mark RMBC »

Hi lotsaram,

good point about the .Properties, I think that this is the only notation that will be acceptable in the next gen version of planning analytics, so mdx something like this:

Code: Select all

{FILTER({TM1FILTERBYLEVEL( TM1SubsetToSet([Employee], "Dyna_Existing"),0)}, INSTR([Employee].currentmember.Properties("AliasName"), "Hargrove,Chr") <>0)} 
regards,

Mark
dharav9
Posts: 72
Joined: Wed Aug 15, 2018 3:18 pm
OLAP Product: TM1
Version: 10.3
Excel Version: 2016

Re: TM1 MDX did not work in TI

Post by dharav9 »

lotsaram wrote: Thu Oct 28, 2021 8:32 am I think Mark RMBC correctly identified the issue. TM1FilterByPattern acts on the alias assigned to the subset. So if the wildcard searc on "*Hargrove,Chr*" relies on an alias then that is the reason.

For something that will ALWAYS work then you need to get the attribute value with CurrentMember.Properties("attributeName") and INSTR which is the equivalent of SCAN in MDX.
Thank You Lotsaram & Mark & all.

I had tried with INSTR function before I posted in the forum. I hadn't had utilize currentmemeber.properties extension. It work with that extension.

Appreciated.
Dharav
Post Reply