rule line error runtime error :circular reference, evaluation stack

Post Reply
mrdauduong
Posts: 52
Joined: Mon Sep 26, 2022 11:10 am
OLAP Product: Planning analytics
Version: PA 2.0.74.23
Excel Version: Excel 2016

rule line error runtime error :circular reference, evaluation stack

Post by mrdauduong »

hi,

today, i got this error that i never seen that before, so, any help or any exp will be appreciated ! :idea:

thanks !

my trouble
trouble rule.png
trouble rule.png (45.29 KiB) Viewed 1731 times
trouble rule 2.png
trouble rule 2.png (568.71 KiB) Viewed 1731 times
Last edited by mrdauduong on Wed Oct 19, 2022 5:35 am, edited 1 time in total.
Emixam
Posts: 139
Joined: Tue May 21, 2019 3:33 pm
OLAP Product: TM1
Version: PA 2.0.x
Excel Version: 2016
Location: The Internet

Re: rule line error runtime error :circular reference, evaluation stack

Post by Emixam »

People usually pay me to fix that kind of problem. I feel like every time you have an issue, you post on this forum.
Wim Gielis
MVP
Posts: 3118
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.0.9.18
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: rule line error runtime error :circular reference, evaluation stack

Post by Wim Gielis »

Emixam wrote: Tue Oct 18, 2022 3:58 pm People usually pay me to fix that kind of problem. I feel like every time you have an issue, you post on this forum.
:lol:

Creating 11 topics in the first 20 days is quite a high average.
Best regards,

Wim Gielis

IBM Champion 2024
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
lotsaram
MVP
Posts: 3654
Joined: Fri Mar 13, 2009 11:14 am
OLAP Product: TableManager1
Version: PA 2.0.x
Excel Version: Office 365
Location: Switzerland

Re: rule line error runtime error :circular reference, evaluation stack

Post by lotsaram »

Emixam wrote: Tue Oct 18, 2022 3:58 pm People usually pay me to fix that kind of problem. I feel like every time you have an issue, you post on this forum.
Yeah dude seriously no one is going to read through that much code and provide you with a free answer (not even Declan).
A circular reference is exactly what the error says it is. Find it and fix it.
Please place all requests for help in a public thread. I will not answer PMs requesting assistance.
mrdauduong
Posts: 52
Joined: Mon Sep 26, 2022 11:10 am
OLAP Product: Planning analytics
Version: PA 2.0.74.23
Excel Version: Excel 2016

Re: rule line error runtime error :circular reference, evaluation stack

Post by mrdauduong »

To be honest, in beginning, my question is only "what is a circular reference rules"
In the forum rule, i saw that i need to be as clear as possible. this is why i try to post all code here.
But this is maybe not a good way to ask a question. Iam sorry about that. :oops:
MarenC
Regular Participant
Posts: 350
Joined: Sat Jun 08, 2019 9:55 am
OLAP Product: Planning Analytics
Version: Planning Analytics 2.0
Excel Version: Excel 2016

Re: rule line error runtime error :circular reference, evaluation stack

Post by MarenC »

Hi,

as the others have said this is a painstaking find and fix problem.

One other thing I will mention, I am pretty sure that I have seen in the past too many continue statements causing similar problems.

So if you get really stuck after a painstaking trawl through the rules, you might want to look at that and and try and combine into nested if statements.

Maren
mrdauduong
Posts: 52
Joined: Mon Sep 26, 2022 11:10 am
OLAP Product: Planning analytics
Version: PA 2.0.74.23
Excel Version: Excel 2016

Re: rule line error runtime error :circular reference, evaluation stack

Post by mrdauduong »

Thank maren for the reponse, problem solved, i found that i compare A with B while B is calculed by A. but i still dont understand why it cause reference circular error.

B = A * coefficient (0,1-1)
i have a condition if (B>A), B, A.

I still need to do this and i need to understand why there are a reference circular here. :ugeek:


Thanks !


So if you get really stuck after a painstaking trawl through the rules, you might want to look at that and and try and combine into nested if statements. ==> this is a good advise, i use continue a lot before but now, i try to use if to replace
MarenC wrote: Wed Oct 19, 2022 7:29 am Hi,

as the others have said this is a painstaking find and fix problem.

One other thing I will mention, I am pretty sure that I have seen in the past too many continue statements causing similar problems.

So if you get really stuck after a painstaking trawl through the rules, you might want to look at that and and try and combine into nested if statements.

Maren
User avatar
Steve Rowe
Site Admin
Posts: 2417
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: rule line error runtime error :circular reference, evaluation stack

Post by Steve Rowe »

wrt to a circular reference one thing that isn't always obvious until it happens to you the first time is that you need to consider rules and consolidations in the dimension together.

To illustrate this with a silly example.

Say your period dimension has Jan rolling into Year.

and you write a rule

['Measure A' , 'Jan']=N: ['Measure A', 'Full Year'];

Then you create a circular reference since in the rule Jan depends on Full Year and in the consolidation Full Year depends on Jan.

Note though that the below isn't circular (unless Measure B and Measure A are also dependant on each other).
['Measure A' , 'Jan']=N: ['Measure B', 'Full Year'];
Technical Director
www.infocat.co.uk
Wim Gielis
MVP
Posts: 3118
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.0.9.18
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: rule line error runtime error :circular reference, evaluation stack

Post by Wim Gielis »

Did you google for a second ?
For instance: TM1 rule circular reference
The very first hit is: https://code.cubewise.com/blog/resolvin ... alculation
Best regards,

Wim Gielis

IBM Champion 2024
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
mrdauduong
Posts: 52
Joined: Mon Sep 26, 2022 11:10 am
OLAP Product: Planning analytics
Version: PA 2.0.74.23
Excel Version: Excel 2016

Re: rule line error runtime error :circular reference, evaluation stack

Post by mrdauduong »

Thank for the explain! i have it something in excel formula but this is a first time i have in TM1, i have no idea why a condition can make a reference circular while it work on 1 but not other

probleme is on this line, but this line dont make the trouble in the first case (PR1 MAX)
rule line error.png
rule line error.png (374.7 KiB) Viewed 1570 times

Code: Select all

['PR1_CALCUL_MAX'] = N: 
IF(DB('D_PRICING_SELECT_SIMULATION', !D_PRICING_DIM_VERSION, !D_PRICING_PDTS_GROUPE_PRIX_RELATION,'Value') @= 'Oui'
&ATTRS('D_PRICING_DIM_PDTS', !D_PRICING_PDTS_GROUPE_PRIX_RELATION, 'REF_BENCHMARK')@=''
	,0
	,if(attrs('D_PRICING_PDTS_GROUPE_PRIX_RELATION',!D_PRICING_PDTS_GROUPE_PRIX_RELATION,'type_element')@=''
		,if(DB('D_PRICING_SIMULATION', !D_PRICING_DIM_VERSION, !D_PRICING_DIM_POS, !D_PRICING_DIM_ORGA, !D_PRICING_PDTS_GROUPE_PRIX_RELATION, 'SIM')<DB('D_PRICING_SIMULATION', !D_PRICING_DIM_VERSION, !D_PRICING_DIM_POS, !D_PRICING_DIM_ORGA, !D_PRICING_PDTS_GROUPE_PRIX_RELATION, 'PR1')
		
			,DB('D_PRICING_SIMULATION', !D_PRICING_DIM_VERSION, !D_PRICING_DIM_POS, !D_PRICING_DIM_ORGA, !D_PRICING_PDTS_GROUPE_PRIX_RELATION, 'PR1')
			,DB('D_PRICING_SIMULATION', !D_PRICING_DIM_VERSION, !D_PRICING_DIM_POS, !D_PRICING_DIM_ORGA, !D_PRICING_PDTS_GROUPE_PRIX_RELATION, 'SIM'))
			
		,DB('D_PRICING_SIMULATION', !D_PRICING_DIM_VERSION, !D_PRICING_DIM_POS, !D_PRICING_DIM_ORGA, attrs('D_PRICING_PDTS_GROUPE_PRIX_RELATION',!D_PRICING_PDTS_GROUPE_PRIX_RELATION,'element_base'), 'PR1')));
Anyway, thanks for your help ! now, i know where is the problem, i will just delete it and try to make another way. i'am not very smart on math :mrgreen:
MarenC
Regular Participant
Posts: 350
Joined: Sat Jun 08, 2019 9:55 am
OLAP Product: Planning Analytics
Version: Planning Analytics 2.0
Excel Version: Excel 2016

Re: rule line error runtime error :circular reference, evaluation stack

Post by MarenC »

Hi,

Bit puzzled why the REF_BENCHMARK ATTRS for D_PRICING_GROUPE_PRIX_RELATION would be asking if it was equal to itself?

If you removed that ATTRS does it work then?

Other than that not enough information to provide an answer and as others have already said, not something anyone has time for really.

Maren
mrdauduong
Posts: 52
Joined: Mon Sep 26, 2022 11:10 am
OLAP Product: Planning analytics
Version: PA 2.0.74.23
Excel Version: Excel 2016

Re: rule line error runtime error :circular reference, evaluation stack

Post by mrdauduong »

Thank maren for the reponse, we can close the topic here.

To answer your question :
- Bit puzzled why the REF_BENCHMARK ATTRS for D_PRICING_GROUPE_PRIX_RELATION would be asking if it was equal to itself? ==> because i have to apply this rule only for the element who have himself in the attribut REF_BENCHMARK
- If you removed that ATTRS does it work then? => it work if i romove that ATTRS, this is why i dont understand :mrgreen:

==> i will try another way to do this thing or use a TI.

Thanks your help !
MarenC wrote: Thu Oct 20, 2022 8:18 am Hi,

Bit puzzled why the REF_BENCHMARK ATTRS for D_PRICING_GROUPE_PRIX_RELATION would be asking if it was equal to itself?

If you removed that ATTRS does it work then?

Other than that not enough information to provide an answer and as others have already said, not something anyone has time for really.

Maren
Post Reply