TI process to fill element in cube with 1's

Post Reply
kudzis
Posts: 42
Joined: Wed Nov 10, 2010 12:35 pm
OLAP Product: Cognos 8 BI
Version: 9.5.1
Excel Version: Excel 2007

TI process to fill element in cube with 1's

Post by kudzis »

Hello,

I want to fill a specific measure in cube with 1's. I can do this with rule ['My measure'] = N: 1; however, this rule will not work with feeders.
I can fill 1's with spreading (data spread > repeat leaves), but I don't want to do this manually every time when I zero out cube before loading data.
I figured that TI process will be the best choice. Could you please give me a basic example how to do this?
User avatar
qml
MVP
Posts: 1098
Joined: Mon Feb 01, 2010 1:01 pm
OLAP Product: TM1 / Planning Analytics
Version: 2.0.9 and all previous
Excel Version: 2007 - 2016
Location: London, UK, Europe

Re: TI process to fill element in cube with 1's

Post by qml »

A couple of questions.

What do you need this "measure" for?
Why would you want to feed this rule (do you need this measure to consolidate)?

Also, you can feed this rule, but it would have to be from a cell that is certain to have a value at all times.

Depending on what you need this for it might be a good solution to have this rule-based and not feed it. It would keep the memory usage to a minimum.

TI would also be possible and really easy to write (hint: think what your data source would be).
Kamil Arendt
User avatar
vinnusea
Posts: 116
Joined: Thu Sep 23, 2010 6:12 pm
OLAP Product: TM1
Version: 10.2
Excel Version: 2010
Location: San Diego ,CA

Re: TI process to fill element in cube with 1's

Post by vinnusea »

Hi,
You can write TI process with while loops ,looping through all the elements in dimensions and populate 1's in all cube intersections and run process manually or in chores based on your requirement.
Thanks
Vinnusea
David Usherwood
Site Admin
Posts: 1458
Joined: Wed May 28, 2008 9:09 am

Re: TI process to fill element in cube with 1's

Post by David Usherwood »

Wouldn't it be easier to create a view with the cells to which you wish to write your 1s, then cellputn(1,... to each of them?
Not that I'm convinced that writing 1s all over a cube is a sensible design though.
User avatar
qml
MVP
Posts: 1098
Joined: Mon Feb 01, 2010 1:01 pm
OLAP Product: TM1 / Planning Analytics
Version: 2.0.9 and all previous
Excel Version: 2007 - 2016
Location: London, UK, Europe

Re: TI process to fill element in cube with 1's

Post by qml »

David Usherwood wrote:Wouldn't it be easier to create a view with the cells to which you wish to write your 1s, then cellputn(1,... to each of them?
Second that.
David Usherwood wrote:Not that I'm convinced that writing 1s all over a cube is a sensible design though.
And that as well.
Kamil Arendt
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: TI process to fill element in cube with 1's

Post by tomok »

David Usherwood wrote:Not that I'm convinced that writing 1s all over a cube is a sensible design though.
Depends on what you are using it for. I have employed this method to use as a feeder when there was simply no way to use any other data in the model with which to write an effective feeder. When I say effective, I mean one that isn't either ridiculously complicated or overfeeds. In these type situations I'll post a value of 1 to a dummy measure (usually called feeder_flag) for all combinations in the cube that need feeding and which I was not able to come up with a better way to feed. As long as I keep the feeder_Flag element populated appropriately it works great.
Tom O'Kelley - Manager Finance Systems
American Tower
http://www.onlinecourtreservations.com/
Gregor Koch
MVP
Posts: 263
Joined: Fri Jun 27, 2008 12:15 am
OLAP Product: Cognos TM1, CX
Version: 9.0 and up
Excel Version: 2007 and up

Re: TI process to fill element in cube with 1's

Post by Gregor Koch »

Agree with tomok, there are definitely situations where it is helpful to use this approach.
Andy Key
MVP
Posts: 352
Joined: Wed May 14, 2008 1:37 pm
OLAP Product: TM1
Version: 2.5 to PA
Excel Version: Lots
Location: Sydney
Contact:

Re: TI process to fill element in cube with 1's

Post by Andy Key »

tomok wrote:I'll post a value of 1 ... for all combinations in the cube that need feeding
is a different scenario to
kudzis wrote:['My measure'] = N: 1;
Feeder flags in explicit combinations make sense, 1 in all combinations - depending on the purpose - possibly needs a design rethink.
Andy Key
User avatar
qml
MVP
Posts: 1098
Joined: Mon Feb 01, 2010 1:01 pm
OLAP Product: TM1 / Planning Analytics
Version: 2.0.9 and all previous
Excel Version: 2007 - 2016
Location: London, UK, Europe

Re: TI process to fill element in cube with 1's

Post by qml »

Guys, I don't think we have enough material for this argument to go on. The OP hasn't explained what he needs this for, so it could either be a good idea, or a bad one. Either way, there are a few ideas for the OP to go with in this thread.
Kamil Arendt
kudzis
Posts: 42
Joined: Wed Nov 10, 2010 12:35 pm
OLAP Product: Cognos 8 BI
Version: 9.5.1
Excel Version: Excel 2007

Re: TI process to fill element in cube with 1's

Post by kudzis »

Hello,

sorry for a late reply and thank you everyone for your ideas and contributions to my problem.

I've solved my filling problem by creating a view as a source (selected only my 'dummy' measure and unchecked "skip zero/blank values"), then created a numeric variable (formula: variable = 1;), set contents to "data" and loaded everything into a cube.

Now for the need to do this. How can I feed this rule without using my 'dummy' measure:

['Parduodama šiluminė energija' ] = N: IF(DB('ag AG Informacija', !Versijos, !ag Tekstas, !ag AG, 'Parduodama šiluminė energija (taip/ne)')@='Taip',1,2);
User avatar
qml
MVP
Posts: 1098
Joined: Mon Feb 01, 2010 1:01 pm
OLAP Product: TM1 / Planning Analytics
Version: 2.0.9 and all previous
Excel Version: 2007 - 2016
Location: London, UK, Europe

Re: TI process to fill element in cube with 1's

Post by qml »

Do you need values calculated by this rule to consolidate? Maybe you can use a rule that would work for all elements (no "N:" quantifier) instead? If you really need it to consolidate normally (and therefore must feed it), all you need to have is one cell with a non-zero input value (it can be anywhere, even in a different cube) and you can feed from it to the top consolidations across your dimensions (feeding all their children). You do not need multiple cells filled with ones to feed this rule.
Kamil Arendt
kudzis
Posts: 42
Joined: Wed Nov 10, 2010 12:35 pm
OLAP Product: Cognos 8 BI
Version: 9.5.1
Excel Version: Excel 2007

Re: TI process to fill element in cube with 1's

Post by kudzis »

qml wrote:Do you need values calculated by this rule to consolidate?
No, but I need this measure as an intermediate step to calculate another measure, which needs to consolidate. Feeding the top elements would be a good idea though - I should give it a try.
User avatar
qml
MVP
Posts: 1098
Joined: Mon Feb 01, 2010 1:01 pm
OLAP Product: TM1 / Planning Analytics
Version: 2.0.9 and all previous
Excel Version: 2007 - 2016
Location: London, UK, Europe

Re: TI process to fill element in cube with 1's

Post by qml »

kudzis wrote:No, but I need this measure as an intermediate step to calculate another measure, which needs to consolidate.
In which case you do not need to feed this intermediate measure at all. You just need to feed the final measure.
Kamil Arendt
kudzis
Posts: 42
Joined: Wed Nov 10, 2010 12:35 pm
OLAP Product: Cognos 8 BI
Version: 9.5.1
Excel Version: Excel 2007

Re: TI process to fill element in cube with 1's

Post by kudzis »

qml wrote:
kudzis wrote:No, but I need this measure as an intermediate step to calculate another measure, which needs to consolidate.
In which case you do not need to feed this intermediate measure at all. You just need to feed the final measure.
Ok, I did some testing and that's what I found out ('dummy' measure is filled with 1's):

Let's say I'm feeding rule ['Final measure'] = N: ['a'] + ['b'];

Feeder ['dummy'] => ['Final measure'] works fine;
Feeder [{'a','b'}] => ['Final measure'] is not working because 'a' and 'b' are calculated and not feeded properly.

So that's why I thought I needed to feed all intermediate measures.
kudzis
Posts: 42
Joined: Wed Nov 10, 2010 12:35 pm
OLAP Product: Cognos 8 BI
Version: 9.5.1
Excel Version: Excel 2007

Re: TI process to fill element in cube with 1's

Post by kudzis »

kudzis wrote:
qml wrote:
kudzis wrote:No, but I need this measure as an intermediate step to calculate another measure, which needs to consolidate.
In which case you do not need to feed this intermediate measure at all. You just need to feed the final measure.
Ok, I did some testing and that's what I found out ('dummy' measure is filled with 1's):

Let's say I'm feeding rule ['Final measure'] = N: ['a'] + ['b'];

Feeder ['dummy'] => ['Final measure'] works fine;
Feeder [{'a','b'}] => ['Final measure'] is not working because 'a' and 'b' are calculated and not feeded properly.

So that's why I thought I needed to feed all intermediate measures.
Completely offtopic: qml, your avatar is from Grim Fandango?
User avatar
qml
MVP
Posts: 1098
Joined: Mon Feb 01, 2010 1:01 pm
OLAP Product: TM1 / Planning Analytics
Version: 2.0.9 and all previous
Excel Version: 2007 - 2016
Location: London, UK, Europe

Re: TI process to fill element in cube with 1's

Post by qml »

kudzis wrote:Feeder [{'a','b'}] => ['Final measure'] is not working because 'a' and 'b' are calculated and not feeded properly.

So that's why I thought I needed to feed all intermediate measures.
You do not have to feed your final measure from your intermediate calculated measures. Just think about which input values cause the final measure to be zero or-non-zero. In some cases this might be impossible to establish and so you might have to feed in a way that is totally detached from the actual calculation path.

Sometimes to avoid overfeeding it's a good idea to create some elaborate objects just to get the most optimal feeder. I'm not saying in your case that's the best option (as I don't know what exactly you're trying to do), but as a general rule it's always better to minimise those feeders that are not needed for anything.

PS: Yes, well spotted, my avatar is Manny from Grim Fandango.
Kamil Arendt
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: TI process to fill element in cube with 1's

Post by tomok »

I’ll give you my dog peeing on a bush example to help you understand. Let’s imagine there is a street in your neighborhood (a cube) that has a lot of bushes (cell intersections) on it. It’s Easter and you are going to have an Easter egg hunt for the kids. You send out a bunch of parents to hide Easters eggs in the bushes. Unfortunately, after they’ve all been hidden, you realize you don’t know how many actual eggs there are out there and this is something you really need to know (a consolidation). We also know that dogs have the unique ability to sniff out eggs and can be trained to pee on every bush that has an egg(s) (a feeder) hidden underneath it. Finally, you also have a robot (the TM1 consolidation engine) that can count eggs and has the unique ability to smell dog urine (a feeder).

So, we send out the neighborhood dogs to sniff out eggs and pee on the bushes. It doesn’t matter which dog pees on the bush, just as long as all the bushes with eggs get peed on. We unleash the robot, which stops only at the bushes with dog urine, and counts the eggs under the bush. So, the moral of the story is that a feeder is nothing more than a marker on a cell intersection so that the TM1 consolidation knows not to skip it when counting values and it doesn't matter where the marker comes from or whether it actually has any relation to the intersection being marked (although it usually does about 99% of the time).
Tom O'Kelley - Manager Finance Systems
American Tower
http://www.onlinecourtreservations.com/
kudzis
Posts: 42
Joined: Wed Nov 10, 2010 12:35 pm
OLAP Product: Cognos 8 BI
Version: 9.5.1
Excel Version: Excel 2007

Re: TI process to fill element in cube with 1's

Post by kudzis »

That is a very nice example Tomok, thank you :)
Andy Key
MVP
Posts: 352
Joined: Wed May 14, 2008 1:37 pm
OLAP Product: TM1
Version: 2.5 to PA
Excel Version: Lots
Location: Sydney
Contact:

Re: TI process to fill element in cube with 1's

Post by Andy Key »

tomok wrote:So, the moral of the story is that a feeder is nothing more than a marker on a cell intersection so that the TM1 consolidation knows not to skip it when counting values and it doesn't matter where the marker comes from or whether it actually has any relation to the intersection being marked (although it usually does about 99% of the time).
Really? I would have said that the moral of the story is Don't eat easter eggs that you find under bushes...
Andy Key
Post Reply