Iteration (circular reference)

Post Reply
TM1_newbie
Posts: 4
Joined: Thu Sep 24, 2009 11:16 pm
OLAP Product: TM1
Version: 9.0
Excel Version: 2003

Iteration (circular reference)

Post by TM1_newbie »

Hi,

I am trying to build an iteration, but am getting an "RUNTIME ERROR: Circular reference, string overflow" message in the tracer.
I am trying to achieve the following and maybe you have an idea of how to set it up a different way or how to avoid the error (would more RAM get it further?)

I have basically an Opening Balance and a Closing Balance and some INs and OUTs inbetween. I also have a calculation that calculates the required orders to stay above a minimum stock (calculated based on the closing balance).This will then of course need to be considered in the Closing Balance and will then affect next months Opening Balance and so forth...
It is a kind of circular reference / iteration, limited by the number of periods. In this model across 72 months.

In Cognos Planning this could be achieved with an internal Link running for one period and then calculating the next period and so forth. Took a few seconds to process, but worked through the 72 months.

When I include it in the rule, it runs for a few seconds and then shows me a lot of #NA's with the above error in the tracer.

Any suggestions appreciated.
THX
User avatar
Steve Rowe
Site Admin
Posts: 2456
Joined: Wed May 14, 2008 4:25 pm
OLAP Product: TM1
Version: TM1 v6,v7,v8,v9,v10,v11+PAW
Excel Version: Nearly all of them

Re: Iteration (circular reference)

Post by Steve Rowe »

Hi and welcome,
There should be no problem doing this in TM1 but you can't actually build the rules to be circular and you need to consider both the rule and the dimension structure when deciding on the circularity.

My suspicion from what you have written is that your minimum stock rule both references the closing balance consolidation and is a child of closing balance. If so what you need to do is create a consolidation called Closing Balance ex Min Stock, put everything in it that is in Closing balance and reference that element in the rules for the Minimum Stock. This should break the circularity of your rule.

If this is not it, then you probably need to post your rules and give some detail on dimension structures.
HTH
Technical Director
www.infocat.co.uk
TM1_newbie
Posts: 4
Joined: Thu Sep 24, 2009 11:16 pm
OLAP Product: TM1
Version: 9.0
Excel Version: 2003

Re: Iteration (circular reference)

Post by TM1_newbie »

Hey Steve,

Thanks for the welcome and your hint.
It is working now. It was a simple tweak in a fairly complex model. As you said, I just changed the way the Stock Closing is calculated without the reference and it's working fine.
For anyone who is interested in some more details or may have the same problem, here are some more details (simplified, though).

Logic before that didn't work and some example numbers:
- Opening Balance 100 (0 for first period, then the Closing Balance of previous period)
- IN 50 (IF "Closing Balance"-"IN"<"Min. Stock", THEN "Order Qty") That was the problem!- OUT 50 (in this example a simple data entry)
- Closing Balance 100 (Opening Balance + IN - OUT)
- Min. Stock 80 (Info only - data entry)
- Order Qty 50 (Info only - data entry)

New Logic that made it happen:
- Opening Balance 100 (0 for first period, then the Closing Balance of previous period)
- IN 50 (IF "Opening Balance" - "OUT" < "Min. Stock", THEN "Order Qty" That solves the cirqular reference.
- OUT 50 (in this example a simple data entry)
- Closing Balance 100 (Opening Balance + IN - OUT)
- Min. Stock 80 (Info only - data entry)
- Order Qty 50 (Info only - data entry)
User avatar
Steve Rowe
Site Admin
Posts: 2456
Joined: Wed May 14, 2008 4:25 pm
OLAP Product: TM1
Version: TM1 v6,v7,v8,v9,v10,v11+PAW
Excel Version: Nearly all of them

Re: Iteration (circular reference)

Post by Steve Rowe »

Hi,
Just thought I'd follow your post up with a small suggestion for performance. It may or may not make a difference depending on the size of your system but it will be a more "correct" approach.

Bare in mind that a ruled value is about ten times as slow to calculate as a consolidated value.

Assuming "Opening Balance" and "OUT" are both in the same cube then you should really calculate "Opening Balance" - "OUT" with a consolidation where OUT has a weighting of -1 rather than doing the arithmetic in the rule. This should improve the speed of your system at the cost of memory.

Are you going to change your user name after you have been doing this a while?? :P
Cheers
Technical Director
www.infocat.co.uk
Post Reply