Attributes Group By

Post Reply
Toto
Posts: 71
Joined: Mon Jul 20, 2009 8:52 am
OLAP Product: TM1
Version: 9.5 Build 9.5.00100.2380
Excel Version: 2003

Attributes Group By

Post by Toto »

Hello,

I have a dimension called Region with a hierarchy city, country, continent. Also I have an text attribute called "population". Every city can have an entry from one of the following: "low", "medium" or "high".

Is it possible to group by this attribute in TM1-Perspective and let TM1 sum up some figures depending on the text attribute?
So e.g. I have

Medium 1000
Low 450.000
High 900.000

Thanks a lot for your help!

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

Re: Attributes Group By

Post by lotsaram »

You could create a dynamic subset for each population category listing the N level cities belonging to each attribute category. Then in a DBRW reference the subset name and TM1 will return the aggregate of the subset members (this is a hidden or undocumented feature, it has been discussed a bit on this forum in the past).

Or you could use TI to create hierarchies based on the attribute values.
User avatar
jim wood
Site Admin
Posts: 3961
Joined: Wed May 14, 2008 1:51 pm
OLAP Product: TM1
Version: PA 2.0.7
Excel Version: Office 365
Location: 37 East 18th Street New York
Contact:

Re: Attributes Group By

Post by jim wood »

lotsaram wrote:Then in a DBRW reference the subset name
I would use the SUBNM forumla in the report. The DBRW would then referance the result.
Struggling through the quagmire of life to reach the other side of who knows where.
Go Build a PC
Jimbo PC Builds on YouTube
OS: Mac OS 11 PA Version: 2.0.7
lotsaram
MVP
Posts: 3706
Joined: Fri Mar 13, 2009 11:14 am
OLAP Product: TableManager1
Version: PA 2.0.x
Excel Version: Office 365
Location: Switzerland

Re: Attributes Group By

Post by lotsaram »

jim wood wrote:I would use the SUBNM forumla in the report. The DBRW would then referance the result.
What do you mean? A SUBNM pulls out element(s) in the subset, but to use a subset as a user defined consolidation what you need to reference in the DBRW is the subset name itself, not the names of the elements. Am I missing something?
User avatar
jim wood
Site Admin
Posts: 3961
Joined: Wed May 14, 2008 1:51 pm
OLAP Product: TM1
Version: PA 2.0.7
Excel Version: Office 365
Location: 37 East 18th Street New York
Contact:

Re: Attributes Group By

Post by jim wood »

Indeed so say if you have a list of elements on your vertical in an excel sheet you can you use subnm to pull the first, second etc...

This means that you can build a flexiable report that expands and contracts depending on the number of members in the subset.
Struggling through the quagmire of life to reach the other side of who knows where.
Go Build a PC
Jimbo PC Builds on YouTube
OS: Mac OS 11 PA Version: 2.0.7
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: Attributes Group By

Post by tomok »

You guys are talking about two different things. Lotsa, you are talking about a single DBRW pulling a consolidated value from the cube with the consolidation being the subset itself. Jim is talking about a dynamic report where the rows (or columns) are dynamic based on the number of elements in the subset. Jim has to add an Excel SUM formula at the end to get the total, not to mention dealing with all the empty rows or columns you would have to build into the structure to make it work "dynamically".
Tom O'Kelley - Manager Finance Systems
American Tower
http://www.onlinecourtreservations.com/
User avatar
jim wood
Site Admin
Posts: 3961
Joined: Wed May 14, 2008 1:51 pm
OLAP Product: TM1
Version: PA 2.0.7
Excel Version: Office 365
Location: 37 East 18th Street New York
Contact:

Re: Attributes Group By

Post by jim wood »

tomok wrote:not to mention dealing with all the empty rows or columns you would have to build into the structure to make it work "dynamically".
Not exactly difficult stuff. A simple IF statement within the DBRW cell takes care of it. I've done this many time.
Struggling through the quagmire of life to reach the other side of who knows where.
Go Build a PC
Jimbo PC Builds on YouTube
OS: Mac OS 11 PA Version: 2.0.7
User avatar
jim wood
Site Admin
Posts: 3961
Joined: Wed May 14, 2008 1:51 pm
OLAP Product: TM1
Version: PA 2.0.7
Excel Version: Office 365
Location: 37 East 18th Street New York
Contact:

Re: Attributes Group By

Post by jim wood »

tomok wrote:add an Excel SUM formula at the end to get the total
I was thinking of putting it at the top (rather than the end) to stop it moving around but hey that must just be me.
Struggling through the quagmire of life to reach the other side of who knows where.
Go Build a PC
Jimbo PC Builds on YouTube
OS: Mac OS 11 PA Version: 2.0.7
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: Attributes Group By

Post by tomok »

jim wood wrote:Not exactly difficult stuff. A simple IF statement within the DBRW cell takes care of it. I've done this many time.
No, not difficult, just a pain. I also forgot to mention you have to decide, in advance, how big the range should be and copy your DBRWs out to that range and add conditional formatting to make them invisible, if empty. Keep in mind I'm talking sans VBA. I generally don't use it because it means I have to have two versions, one for Excel and one for TM1Web.
Tom O'Kelley - Manager Finance Systems
American Tower
http://www.onlinecourtreservations.com/
User avatar
jim wood
Site Admin
Posts: 3961
Joined: Wed May 14, 2008 1:51 pm
OLAP Product: TM1
Version: PA 2.0.7
Excel Version: Office 365
Location: 37 East 18th Street New York
Contact:

Re: Attributes Group By

Post by jim wood »

I agree about the range. As for formatting again that can be taken care of using IF statements rather than VBA. You just need to display null when appropriate. That's the way I've done it in the past but to be fair I haven't published them via TM1 web so I'm not sure if that would work.
Struggling through the quagmire of life to reach the other side of who knows where.
Go Build a PC
Jimbo PC Builds on YouTube
OS: Mac OS 11 PA Version: 2.0.7
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: Attributes Group By

Post by tomok »

jim wood wrote:I agree about the range. As for formatting again that can be taken care of using IF statements rather than VBA. You just need to display null when appropriate. That's the way I've done it in the past but to be fair I haven't published them via TM1 web so I'm not sure if that would work.
When I mentioned VBA I was talking about using it to dynamically copy the DBRW formulas down and/or across. As long as you don't care about unneccesary DBRWs then it's easy to just use conditional formatting to hide unwanted formulas. This works fine in TM1Web.
Tom O'Kelley - Manager Finance Systems
American Tower
http://www.onlinecourtreservations.com/
User avatar
jim wood
Site Admin
Posts: 3961
Joined: Wed May 14, 2008 1:51 pm
OLAP Product: TM1
Version: PA 2.0.7
Excel Version: Office 365
Location: 37 East 18th Street New York
Contact:

Re: Attributes Group By

Post by jim wood »

Ah I get what you mean now and yes that would keep the report optimised rather than keeping a stack of unused forumlas. I guess it depends on the size of the report and how much you expect it to expand / contract.
Struggling through the quagmire of life to reach the other side of who knows where.
Go Build a PC
Jimbo PC Builds on YouTube
OS: Mac OS 11 PA Version: 2.0.7
Post Reply