MDX Wildcards in Active Forms
-
- Posts: 1
- Joined: Mon Feb 18, 2013 3:40 pm
- OLAP Product: TM1
- Version: 10.1
- Excel Version: 2010
MDX Wildcards in Active Forms
Hi
I am trying to add a Wildcard element search as part of the MDX statement in the TM1RPTROW formula in an Active Form.
(TM1 9.5.2)
The idea is to produce a list of all account codes that start with P-, include AT and end with P. The wildcard looks like this P-*AT*P
Here is the full MDX when produced as a recorded expression in the subset editor.
{TM1DRILLDOWNMEMBER( {TM1FILTERBYPATTERN( {TM1SUBSETALL( [Account] )}, "P-*AT*P")}, ALL, RECURSIVE )}
This works as expected.
However, I want to produce this in an Excel cell to be captured by the TM1RPTROW formula. I can use char(34) referencing other cells but I need to be able to tell it that this is a wildcard search and not a text string element.
The formula I currently have in the cell in Excel is...(where Wildcard is a named ranged to P-*AT*P)
="{TM1DRILLDOWNMEMBER( {TM1FILTERBYPATTERN( {TM1SUBSETALL( [Account] )}, "&CHAR(34)&Wildcard&CHAR(34)&")}, ALL, RECURSIVE )"
If anyone as an example of an MDX Excel formula that works with Wildcards I would be grateful to have a look. Or if there is any documentation on using Excel cell references within TM1 MDX
that would also be useful.
This ideally needs to be an Excel solution only otherwise I can update a subset separately using TI via Action Button.
Thanks
I am trying to add a Wildcard element search as part of the MDX statement in the TM1RPTROW formula in an Active Form.
(TM1 9.5.2)
The idea is to produce a list of all account codes that start with P-, include AT and end with P. The wildcard looks like this P-*AT*P
Here is the full MDX when produced as a recorded expression in the subset editor.
{TM1DRILLDOWNMEMBER( {TM1FILTERBYPATTERN( {TM1SUBSETALL( [Account] )}, "P-*AT*P")}, ALL, RECURSIVE )}
This works as expected.
However, I want to produce this in an Excel cell to be captured by the TM1RPTROW formula. I can use char(34) referencing other cells but I need to be able to tell it that this is a wildcard search and not a text string element.
The formula I currently have in the cell in Excel is...(where Wildcard is a named ranged to P-*AT*P)
="{TM1DRILLDOWNMEMBER( {TM1FILTERBYPATTERN( {TM1SUBSETALL( [Account] )}, "&CHAR(34)&Wildcard&CHAR(34)&")}, ALL, RECURSIVE )"
If anyone as an example of an MDX Excel formula that works with Wildcards I would be grateful to have a look. Or if there is any documentation on using Excel cell references within TM1 MDX
that would also be useful.
This ideally needs to be an Excel solution only otherwise I can update a subset separately using TI via Action Button.
Thanks
-
- Regular Participant
- Posts: 173
- Joined: Sat Mar 20, 2010 3:03 pm
- OLAP Product: TM1
- Version: 9.5.2
- Excel Version: 2007-10
Re: MDX Wildcards in Active Forms
Is this the sort of thing you are looking for?
- Michel Zijlema
- Site Admin
- Posts: 712
- Joined: Wed May 14, 2008 5:22 am
- OLAP Product: TM1, PALO
- Version: both 2.5 and higher
- Excel Version: 2003-2007-2010
- Location: Netherlands
- Contact:
Re: MDX Wildcards in Active Forms
I have a more or less similar issue:
I have a 3-dim InputCube, consisting of a Years, InputLines and InputVariables dimensions. I've built an Active Form with the InputLines on the rows and the InputVariables on the colums.
I'm trying to simulate some autofilter behaviour in this AF using an MDX filter on the InputLines dimension, filterering on parts of values in the input data. F.i. I would like to filter on all lines that have the Accountmanager Name field set to a value containing "Doe". I use the Instr() function for the simple 'wildcard' selection.
The following expression works in the Subset Editor when applied to the InputLines dimension:
But the following TM1RPTROW function containing the same expression is not returning any rows:
When I only use {[InputLines].Members} in the MDX part of the TM1RPTROW formula the function works (returning all rows).
Are there known limitations to the use of MDX in Active Forms opposed to the use in the Subset Editor?
Michel
PS. I'm on TM1 10.1, using Excel 2010
I have a 3-dim InputCube, consisting of a Years, InputLines and InputVariables dimensions. I've built an Active Form with the InputLines on the rows and the InputVariables on the colums.
I'm trying to simulate some autofilter behaviour in this AF using an MDX filter on the InputLines dimension, filterering on parts of values in the input data. F.i. I would like to filter on all lines that have the Accountmanager Name field set to a value containing "Doe". I use the Instr() function for the simple 'wildcard' selection.
The following expression works in the Subset Editor when applied to the InputLines dimension:
Code: Select all
{ FILTER( {[InputLines].Members}, Instr([InputCube].([Years].[All years^2012],[InputVariables].[Accountmanager Name]), 'Doe')> = 1) }
Code: Select all
=TM1RPTROW($B$9;"TM1Serv:InputLines";"";"";"";0;"{ FILTER( {[InputLines].Members}, Instr([InputCube].([Years].[All years^2012],[InputVariables].[Accountmanager Name]), 'Doe')> = 1) }")
Are there known limitations to the use of MDX in Active Forms opposed to the use in the Subset Editor?
Michel
PS. I'm on TM1 10.1, using Excel 2010
-
- Regular Participant
- Posts: 173
- Joined: Sat Mar 20, 2010 3:03 pm
- OLAP Product: TM1
- Version: 9.5.2
- Excel Version: 2007-10
Re: MDX Wildcards in Active Forms
I tend to build the MDX statement in a seperate cell which I the reference from the TM1RPTROW function as shown below:-
This seems to work OK for me.
This seems to work OK for me.
-
- Regular Participant
- Posts: 173
- Joined: Sat Mar 20, 2010 3:03 pm
- OLAP Product: TM1
- Version: 9.5.2
- Excel Version: 2007-10
Re: MDX Wildcards in Active Forms
so a simple dynamic version might look like this:-
- Michel Zijlema
- Site Admin
- Posts: 712
- Joined: Wed May 14, 2008 5:22 am
- OLAP Product: TM1, PALO
- Version: both 2.5 and higher
- Excel Version: 2003-2007-2010
- Location: Netherlands
- Contact:
Re: MDX Wildcards in Active Forms
Hi AmbPin,
Thanks for your reply. The example I posted is simplified - I build up the expression in a separate cell using parameter cells for f.i. year and search string. This was not working, so I step by step simplified the code, but nothing seems to work. Please note that I'm not selection on a pattern of the element names in a dimension. I'm selecting the elements in the InputLines dimension (line 1 to 1000) for which the cell values (in the example regarding the InputVariable "Accountmanager Name" and the Year "2012") in the InputCube cube contain the search value.
Michel
Thanks for your reply. The example I posted is simplified - I build up the expression in a separate cell using parameter cells for f.i. year and search string. This was not working, so I step by step simplified the code, but nothing seems to work. Please note that I'm not selection on a pattern of the element names in a dimension. I'm selecting the elements in the InputLines dimension (line 1 to 1000) for which the cell values (in the example regarding the InputVariable "Accountmanager Name" and the Year "2012") in the InputCube cube contain the search value.
Michel
-
- Regular Participant
- Posts: 173
- Joined: Sat Mar 20, 2010 3:03 pm
- OLAP Product: TM1
- Version: 9.5.2
- Excel Version: 2007-10
Re: MDX Wildcards in Active Forms
Hello Michel,
I dont think your issue is the same as the one I was trying to address for merowen. In your case Michel it may be that you are simply not able to call the VBA type function "INSTR" in an MDX statement from within Excel. I created a test statement similar to yours in my test environment, it works within Architect but I cannot pass it via the TM1RPTROW function successfully.
I dont think your issue is the same as the one I was trying to address for merowen. In your case Michel it may be that you are simply not able to call the VBA type function "INSTR" in an MDX statement from within Excel. I created a test statement similar to yours in my test environment, it works within Architect but I cannot pass it via the TM1RPTROW function successfully.
- Michel Zijlema
- Site Admin
- Posts: 712
- Joined: Wed May 14, 2008 5:22 am
- OLAP Product: TM1, PALO
- Version: both 2.5 and higher
- Excel Version: 2003-2007-2010
- Location: Netherlands
- Contact:
Re: MDX Wildcards in Active Forms
Hi Ambpin,AmbPin wrote:I dont think your issue is the same as the one I was trying to address for merowen. In your case Michel it may be that you are simply not able to call the VBA type function "INSTR" in an MDX statement from within Excel. I created a test statement similar to yours in my test environment, it works within Architect but I cannot pass it via the TM1RPTROW function successfully.
The Instr function is an MDX function - I'm not doing anything with VBA. As mentioned in my first post the example code is delivering the required results when pasted in the expression pane in the Subset Editor, but not when passed as an argument to the TM1RPTROW function.
Michel
- Michel Zijlema
- Site Admin
- Posts: 712
- Joined: Wed May 14, 2008 5:22 am
- OLAP Product: TM1, PALO
- Version: both 2.5 and higher
- Excel Version: 2003-2007-2010
- Location: Netherlands
- Contact:
Re: MDX Wildcards in Active Forms
I read your answer too quickly - I see we're actually saying the same thing here...Michel Zijlema wrote:Hi Ambpin,AmbPin wrote:I dont think your issue is the same as the one I was trying to address for merowen. In your case Michel it may be that you are simply not able to call the VBA type function "INSTR" in an MDX statement from within Excel. I created a test statement similar to yours in my test environment, it works within Architect but I cannot pass it via the TM1RPTROW function successfully.
The Instr function is an MDX function - I'm not doing anything with VBA. As mentioned in my first post the example code is delivering the required results when pasted in the expression pane in the Subset Editor, but not when passed as an argument to the TM1RPTROW function.
Michel
-
- Regular Participant
- Posts: 173
- Joined: Sat Mar 20, 2010 3:03 pm
- OLAP Product: TM1
- Version: 9.5.2
- Excel Version: 2007-10
Re: MDX Wildcards in Active Forms
Michel,
This works for me which proves it is OK to call the INSTR function from Excel.
I guess the problem must be with the other aspects of your statement:-
Why are there ";" after "TM1RPTROW($B$9;"TM1Serv:InputLines"? In my statement these are commas.
This works for me which proves it is OK to call the INSTR function from Excel.
I guess the problem must be with the other aspects of your statement:-
Code: Select all
=TM1RPTROW($B$9;"TM1Serv:InputLines";"";"";"";0;"{ FILTER( {[InputLines].Members}, Instr([InputCube].([Years].[All years^2012],[InputVariables].[Accountmanager Name]), 'Doe')> = 1) }")
- Michel Zijlema
- Site Admin
- Posts: 712
- Joined: Wed May 14, 2008 5:22 am
- OLAP Product: TM1, PALO
- Version: both 2.5 and higher
- Excel Version: 2003-2007-2010
- Location: Netherlands
- Contact:
Re: MDX Wildcards in Active Forms
Hi AmbPin,AmbPin wrote:Why are there ";" after "TM1RPTROW($B$9;"TM1Serv:InputLines"? In my statement these are commas.
Thanks for your efforts. I suspect the problem is that the Active Form TM1RPTROW function has problems with filtering on a cell value, whereas the Subset Editor is not - not the first piece of TM1 inconsistent behaviour

The semicolon instead of comma (and vice verssa) has to do with a difference in our Regional Settings.
Michel