Page 1 of 1

Rules and defining Areas partially twice

Posted: Thu Aug 12, 2010 11:31 am
by RLewin
Hey everyone,

i've got a question regarding rules and how they work, if one defines an area partially twice. I've got two rule lines (in this order):

['Europe','Article 1','2010']=N:0;

['Article 1', '2010']= N:1

Shouldn't the first line overwrite the second for all dimension elements, that are element 'Europe'? And all other elements of this dimension should be calculated by the second line?

Regards,
Roger

Re: Rules and defining Areas partially twice

Posted: Thu Aug 12, 2010 11:38 am
by kpk
"Shouldn't the first line overwrite the second for all dimension elements, that are element 'Europe'? And all other elements of this dimension should be calculated by the second line?"

Do you mean that Europe is a C level element in one of the dimensions?
If yes, then the first rule line will never work.

Kind Regards,
Peter

Re: Rules and defining Areas partially twice

Posted: Thu Aug 12, 2010 11:41 am
by RLewin
Erm, no ;)

Imagine the first dimension as a flat dimension with no hierarchic structure. Let's say the Elements are Europe, Northern America, Asia, Africa

Here is the real code:

Code: Select all

[{'87216000','87219000','87225000','87250000','87276000','87279000','87116000','87119000','87121000','87150000','87176000','87179000',
'87316000','87319000','87329000','87350000','87376000','87379000','87516000','87519000','87579000','88519000','87490000'},'Ist',
{'Haushalt','Zähler','Gewerbe','Landwirtschaft','Agenturen Autogas','Eigenhändler Autogas','Sonstige Autogas','Staplergas','Brenngas',
'Global','Industrie','Air Liquide','Bau','Gastronomie','Sonstige','OBI','Max Bahr','Hellweg','VST','Aerosol','Beteiligungen','ZG Allgemein',
'Rest Infrastruktur','Infrastruktur','Overhead','Abgrenzungen'},
'Verteilung nicht spartengenauer FiBu-Daten'] = N:0;


['Ist',{'Haushalt','Zähler','Gewerbe','Landwirtschaft','Agenturen Autogas','Eigenhändler Autogas','Sonstige Autogas','Staplergas','Brenngas','Global','Industrie','Air Liquide',
'Bau','Gastronomie','Sonstige','OBI','Max Bahr','Hellweg','VST','Aerosol','Beteiligungen','ZG Allgemein','Rest Infrastruktur','Infrastruktur','Overhead'},
'Verteilung nicht spartengenauer FiBu-Daten']=

N:(
   DB('Finanzdaten', !Jahre, !Monate, 'Hilfssparten', !Kostenstellen, !Kostenarten, 'Ist')
   - DB('Finanzdaten', !Jahre, !Monate, 'AV', !Kostenstellen, !Kostenarten, 'Ist')
)
*

(
  DB('Spartenergebnis', !Jahre, ELPAR('Monate',!Monate,1), !Sparten,
     IF(ELPAR('Kostenarten',!Kostenarten,1)@='Abgrenzungskonten',ELPAR('Kostenarten',!Kostenarten,2),ELPAR('Kostenarten',!Kostenarten,1)), ELPAR('Kostenstellen',!Kostenstellen,1), !Datenarten, 'Originär + Direkt + Overhead')\
  (
     DB('Spartenergebnis', !Jahre, ELPAR('Monate',!Monate,1), 'Alle Sparten',
         IF(ELPAR('Kostenarten',!Kostenarten,1)@='Abgrenzungskonten',ELPAR('Kostenarten',!Kostenarten,2),ELPAR('Kostenarten',!Kostenarten,1)), ELPAR('Kostenstellen',!Kostenstellen,1),!Datenarten, 'Originär + Direkt + Overhead')-
     DB('Spartenergebnis', !Jahre, ELPAR('Monate',!Monate,1), 'Abgrenzungen',
         IF(ELPAR('Kostenarten',!Kostenarten,1)@='Abgrenzungskonten',ELPAR('Kostenarten',!Kostenarten,2),ELPAR('Kostenarten',!Kostenarten,1)), ELPAR('Kostenstellen',!Kostenstellen,1),!Datenarten, 'Originär + Direkt + Overhead')
  )
);

Re: Rules and defining Areas partially twice

Posted: Thu Aug 12, 2010 12:31 pm
by kpk
The first statement assigns the value 0 to the Europe / Article 1 / 2010 cells.
It takes precedence over the second statement, which specifies that all other countries / Article 1 / 2010 should be 1.

['Europe','Article 1','2010']=N:0;
['Article 1', '2010']= N:1

Re: Rules and defining Areas partially twice

Posted: Thu Aug 12, 2010 12:36 pm
by RLewin
So my example should work. But it does not. Any hint?

Re: Rules and defining Areas partially twice

Posted: Thu Aug 12, 2010 1:47 pm
by kpk
Create a simple N level view with some test element.
Use the rule tracer (at right click) to see which rule is valid for the miscalculated cell.

Re: Rules and defining Areas partially twice

Posted: Thu Aug 12, 2010 2:02 pm
by RLewin
Already did. It's the second line, although the element would be Europe. In my case its one of the adressed cost types. I'm puzzled...

Re: Rules and defining Areas partially twice

Posted: Thu Aug 12, 2010 2:08 pm
by kpk
Please specify the cell which is miscalculated:
Eg.: ['87216000','Ist','Haushalt','Verteilung nicht spartengenauer FiBu-Daten']

Re: Rules and defining Areas partially twice

Posted: Thu Aug 12, 2010 2:42 pm
by RLewin
There are a lot other rule lines, which set the values of othe cost types to zero. Here are the coordinates of one example, i have found.

Year: 2010
Month: 6
Type of Cost: 87276000
Branch: Zähler
cost unit: 1950
level of allocation: Verteilung nicht spartengenauer FiBu-Daten
data type: Ist
value: 11237.11

Re: Rules and defining Areas partially twice

Posted: Thu Aug 12, 2010 3:42 pm
by kpk
Based on the sample you provided is seems to me that it should be 0.
2 questions:
- are you sure that the first rule line saved in the cube at all? Could you check in the rule editor especially if you use XRU files for rule maintenance.
- are you sure that the rule which set the value 11237.11 is the second rule line in your example? If you have many rule lines then it is important to know that the value is really calculated by the second rule not a 3rd one.

Re: Rules and defining Areas partially twice

Posted: Fri Aug 13, 2010 7:10 am
by RLewin
Yes, i'm absolutely sure, that it is the second line of code i provided. it's distinctively the second line.

I also started asking myself, if it is maybe a probem caused be the sheer length of the rule. There are about 3000 lines by now. i saved the rule with the old editor and also the new editor, just to make sure, if there's a difference in saving behaviour. I also checked the *.rux-File. The lines, which set the value to zero because of a given type of cost are there, so it seems, they were saved.

Re: Rules and defining Areas partially twice

Posted: Fri Aug 13, 2010 8:34 am
by RLewin
Things are getting really strange. I did an upgrade to FP2, then restarted the services. Now sometimes the values are zero, sometimes not. I created a TI Process with a SaveDataAll;, which runs as a job every 30 minutes.

Looks like a bug or something connected to cubes with large rules?

Re: Rules and defining Areas partially twice

Posted: Mon Aug 16, 2010 12:37 pm
by Neil Watson
HI there,

Is there a ru$ file in the data directory, as this has an impact of rules you save, appear to be saving properly but don't actually change?

More thoughts as they come to me - it may take a while

Cheers
Neil

Re: Rules and defining Areas partially twice

Posted: Tue Aug 17, 2010 11:48 am
by RLewin
Hey,

i checked and found no *.ru$ File, only *.rux

Nonetheless it seems to me, that FP2 has fixed this odd behaviour

Regards,
Roger