Filter on Dimensions

Post Reply
User avatar
macsir
MVP
Posts: 785
Joined: Wed May 30, 2012 6:50 am
OLAP Product: TM1
Version: PAL 2.0.9
Excel Version: Office 365
Contact:

Filter on Dimensions

Post by macsir »

Hi, Guys

I have two dimensions, say year and month in the cube. I just want a specific period of time of year and month such as from Feb 2013 to July 2015. How can I filter that? Any workable MDX?
In TM1,the answer is always yes though sometimes with a but....
http://tm1sir.blogspot.com.au/
User avatar
macsir
MVP
Posts: 785
Joined: Wed May 30, 2012 6:50 am
OLAP Product: TM1
Version: PAL 2.0.9
Excel Version: Office 365
Contact:

Re: Filter on Dimensions

Post by macsir »

Any idea? :(
In TM1,the answer is always yes though sometimes with a but....
http://tm1sir.blogspot.com.au/
declanr
MVP
Posts: 1831
Joined: Mon Dec 05, 2011 11:51 am
OLAP Product: Cognos TM1
Version: PA2.0 and most of the old ones
Excel Version: All of em
Location: Manchester, United Kingdom
Contact:

Re: Filter on Dimensions

Post by declanr »

macsir wrote:Any idea? :(
It's only been a few hours since the original post; give folk a chance!
macsir wrote:Hi, Guys

I have two dimensions, say year and month in the cube. I just want a specific period of time of year and month such as from Feb 2013 to July 2015. How can I filter that? Any workable MDX?
With 2 period dimensions this isn't possible in a cubeviewer at least not by MDX.
Each dimension can only have 1 list of elements; if year was a title dimension you could have MDX in the month to pull back the relevant periods but MDX can only retrieve 1 subset of elements and that same subset would apply to every element in the year dimension if the 2 were nested together.

You could obviously alter the design to have 1 time dimension or depending what the purpose/other data is you could utilise suppression (but that sounds unlikely to be a worked solution) or of course take it out to a websheet/excel sheet and do whatever you want with it.
Declan Rodger
User avatar
macsir
MVP
Posts: 785
Joined: Wed May 30, 2012 6:50 am
OLAP Product: TM1
Version: PAL 2.0.9
Excel Version: Office 365
Contact:

Re: Filter on Dimensions

Post by macsir »

declanr wrote:
It's only been a few hours since the original post; give folk a chance!
I have been in a little bit hurry coz I think you guys are always quick to help. :D
declanr wrote:
With 2 period dimensions this isn't possible in a cubeviewer at least not by MDX.
Each dimension can only have 1 list of elements; if year was a title dimension you could have MDX in the month to pull back the relevant periods but MDX can only retrieve 1 subset of elements and that same subset would apply to every element in the year dimension if the 2 were nested together.

You could obviously alter the design to have 1 time dimension or depending what the purpose/other data is you could utilise suppression (but that sounds unlikely to be a worked solution) or of course take it out to a websheet/excel sheet and do whatever you want with it.
Thanks for the confirmation. Then I have to merge them into one dimension to get this done. :P
In TM1,the answer is always yes though sometimes with a but....
http://tm1sir.blogspot.com.au/
User avatar
macsir
MVP
Posts: 785
Joined: Wed May 30, 2012 6:50 am
OLAP Product: TM1
Version: PAL 2.0.9
Excel Version: Office 365
Contact:

Re: Filter on Dimensions

Post by macsir »

logically speaking, it is not possible but I just need someone to confirm it. :geek:
In TM1,the answer is always yes though sometimes with a but....
http://tm1sir.blogspot.com.au/
lotsaram
MVP
Posts: 3704
Joined: Fri Mar 13, 2009 11:14 am
OLAP Product: TableManager1
Version: PA 2.0.x
Excel Version: Office 365
Location: Switzerland

Re: Filter on Dimensions

Post by lotsaram »

macsir wrote:Hi, Guys

I have two dimensions, say year and month in the cube. I just want a specific period of time of year and month such as from Feb 2013 to July 2015. How can I filter that? Any workable MDX?
It would be helpful if you actually provided a more concrete example or a screenshot of what you are trying to achieve. Prima facie no native TM1 UI supports asymmetric member selection on rows in a cross-tab. However there are many possible ways using active forms to be able to solve this presentation problem without resorting to redesigning the reporting cube to combine the time dimensions into a single Year-Month dimension.
E.g.
- 2 (or more) active form sections on adjoining rows in the sheet. One active form section per year with a different set of months per year.
- Using a string measure to drive zero suppression on a hidden column
- An auxiliary helper cube with a single time dimension to drive the active form on a hidden column
macsir wrote:logically speaking, it is not possible but I just need someone to confirm it.
An awful lot is possible using active forms plus some creativity. I wouldn't say it isn't possible. Not with the cube viewer and not with an unadulterated "slice out" active form, but certainly it's possible.
Please place all requests for help in a public thread. I will not answer PMs requesting assistance.
User avatar
macsir
MVP
Posts: 785
Joined: Wed May 30, 2012 6:50 am
OLAP Product: TM1
Version: PAL 2.0.9
Excel Version: Office 365
Contact:

Re: Filter on Dimensions

Post by macsir »

Hi,
What I want to achieve is that when user select start time and end time (e.g. 2011 Dec to 2013 Feb), activeform can get this total expense from one DBRW function with Year and Month dimensions separated. There might be some users running this report at same time. Anyone has specific idea?
Attachments
2015-09-01 09_38_24-Microsoft Excel - testStandard4.xlsx.png
2015-09-01 09_38_24-Microsoft Excel - testStandard4.xlsx.png (17.74 KiB) Viewed 6604 times
In TM1,the answer is always yes though sometimes with a but....
http://tm1sir.blogspot.com.au/
lotsaram
MVP
Posts: 3704
Joined: Fri Mar 13, 2009 11:14 am
OLAP Product: TableManager1
Version: PA 2.0.x
Excel Version: Office 365
Location: Switzerland

Re: Filter on Dimensions

Post by lotsaram »

macsir wrote:Hi,
What I want to achieve is that when user select start time and end time (e.g. 2011 Dec to 2013 Feb), activeform can get this total expense from one DBRW function with Year and Month dimensions separated. There might be some users running this report at same time. Anyone has specific idea?
I already gave you several ideas that would work. IMO for what you want to do a small auxiliary cube with a single time dimension to drive the row selection would be the easiest to implement. Doesn't matter if there would be 100s of users using the report at once as there's no need to store the user from/to month selection in a cube as you can set the months to display using simple MDX {[YearMonth].[yyyymm]:[yyyymm]}. Just use a time dimension with indexing in time order and no levels for the purpose. Like Declan said "take it out to a spreadsheet/websheet and do whatever you want with it."

This isn't hard to do. I think any more hints and it's bordering on doing your work for you.
Please place all requests for help in a public thread. I will not answer PMs requesting assistance.
User avatar
macsir
MVP
Posts: 785
Joined: Wed May 30, 2012 6:50 am
OLAP Product: TM1
Version: PAL 2.0.9
Excel Version: Office 365
Contact:

Re: Filter on Dimensions

Post by macsir »

Hi, lotsaram

Yes, I have already tried. I have created a time dimension with year and month and using its attribute cube as based to get values from the source cube. But it looks like it can't get values in second DBRW. E.g. it should show values on 2013 02 row.
Attachments
2015-09-02 09_58_03-Microsoft Excel - testMDX2.xlsx.png
2015-09-02 09_58_03-Microsoft Excel - testMDX2.xlsx.png (18.81 KiB) Viewed 6561 times
2015-09-02 09_56_10-Microsoft Excel - testMDX2.xlsx.png
2015-09-02 09_56_10-Microsoft Excel - testMDX2.xlsx.png (35.04 KiB) Viewed 6561 times
In TM1,the answer is always yes though sometimes with a but....
http://tm1sir.blogspot.com.au/
User avatar
macsir
MVP
Posts: 785
Joined: Wed May 30, 2012 6:50 am
OLAP Product: TM1
Version: PAL 2.0.9
Excel Version: Office 365
Contact:

Re: Filter on Dimensions

Post by macsir »

Actually, after turning on Auto Calculation in excel and rebuilding the sheet, it is showing Key Error but all formulas are in its own right dimension positions.
Attachments
2015-09-02 10_12_05-Microsoft Excel - testMDX2.xlsx.png
2015-09-02 10_12_05-Microsoft Excel - testMDX2.xlsx.png (4.23 KiB) Viewed 6560 times
In TM1,the answer is always yes though sometimes with a but....
http://tm1sir.blogspot.com.au/
tomok
MVP
Posts: 2836
Joined: Tue Feb 16, 2010 2:39 pm
OLAP Product: TM1, Palo
Version: Beginning of time thru 10.2
Excel Version: 2003-2007-2010-2013
Location: Atlanta, GA
Contact:

Re: Filter on Dimensions

Post by tomok »

You can't have DBRW formulas that reference values from other DBRW formulas. This is pretty common knowledge. Change the cells in column C to DBR.
Tom O'Kelley - Manager Finance Systems
American Tower
http://www.onlinecourtreservations.com/
User avatar
macsir
MVP
Posts: 785
Joined: Wed May 30, 2012 6:50 am
OLAP Product: TM1
Version: PAL 2.0.9
Excel Version: Office 365
Contact:

Re: Filter on Dimensions

Post by macsir »

I tried it as well.
All in Key Error.
Attachments
2015-09-02 11_28_38-Microsoft Excel - testMDX2.xlsx.png
2015-09-02 11_28_38-Microsoft Excel - testMDX2.xlsx.png (18.66 KiB) Viewed 6553 times
In TM1,the answer is always yes though sometimes with a but....
http://tm1sir.blogspot.com.au/
User avatar
macsir
MVP
Posts: 785
Joined: Wed May 30, 2012 6:50 am
OLAP Product: TM1
Version: PAL 2.0.9
Excel Version: Office 365
Contact:

Re: Filter on Dimensions

Post by macsir »

Okay, DBR function is the first one to execute in Activeform so any formula inside it won't run untill itself finishes. That's why it is showing error on DBR. I am in the loop now... :?
In TM1,the answer is always yes though sometimes with a but....
http://tm1sir.blogspot.com.au/
lotsaram
MVP
Posts: 3704
Joined: Fri Mar 13, 2009 11:14 am
OLAP Product: TableManager1
Version: PA 2.0.x
Excel Version: Office 365
Location: Switzerland

Re: Filter on Dimensions

Post by lotsaram »

macsir wrote:Hi, lotsaram
Yes, I have already tried. I have created a time dimension with year and month and using its attribute cube as based to get values from the source cube. But it looks like it can't get values in second DBRW. E.g. it should show values on 2013 02 row.
I have no idea why you are doing what you're doing. You already have the YearMonth elements in column B, why on earth pull the value converted to numeric with a DBRW in column C and then convert that back to text and split it? Frankly that's plain dumb, just use a LEFT, RIGHT or MID formula on column B in columns C & D to get your year and months and the job is finished.
Please place all requests for help in a public thread. I will not answer PMs requesting assistance.
User avatar
macsir
MVP
Posts: 785
Joined: Wed May 30, 2012 6:50 am
OLAP Product: TM1
Version: PAL 2.0.9
Excel Version: Office 365
Contact:

Re: Filter on Dimensions

Post by macsir »

Oh, how silly of me! Thanks for pointing that out, lotsaram. :D
Yeah, you are right but the root cause is that I haven't pointed elements into right dimensions which I figured out later. :oops:
In TM1,the answer is always yes though sometimes with a but....
http://tm1sir.blogspot.com.au/
Post Reply