Page 1 of 1

}ElementAttributes Rule and TI conflict

Posted: Tue Feb 06, 2018 9:33 pm
by kenship
Hi,

I have a budget element dimension with different alias sets, each set represents a department. The idea is to allow different alias for different departments using the same budget element.

In the }ElementAttributes cube of the budget element, I put rules to fill the alias content from another cube.

The budget element dimension is built using a TI process and a load file. It runs from time to time as new budget element is added to the dimension.

When TI is run, the alias set will be destroyed and creates an error for the rule. I don't think I can use the viewextractskiprulevalue or cellupdateable as the whole dimension has to be rebuilt.

Can I not worry about the error message in this case?

Thanks!

Re: }ElementAttributes Rule and TI conflict

Posted: Wed Feb 07, 2018 6:44 am
by ascheevel
Can you post the contents of the Prolog tab of the TI process that updates your budget element dimension?

Re: }ElementAttributes Rule and TI conflict

Posted: Wed Feb 07, 2018 9:46 am
by Steve Rowe
Sounds like you are doing a delete and rebuild to the objects concerned.
This is usually a pretty bad idea, it is much better to clear (data, alias values, structure) and refresh, this avoids issues in the servers object model like the one you have encountered where a rule is flagged as invalid when the object is deleted.

Re: }ElementAttributes Rule and TI conflict

Posted: Wed Feb 07, 2018 1:20 pm
by kenship
Here's one of the error messages:

6132 [b4] ERROR 2018-02-07 13:15:26.846 TM1.Dimension }ElementAttributes_Operating_Budget_Element Dimension Update Fail. Rule Is Invalid: Error compiling rule, line number 16: Element not found "05. Finance"

"05. Finance" is the name of the alias set. The process involves AttrDelete and AttrInsert that put the attribute into the dimension and I believe it is where the error message comes from.

I suspended the AttrDelete and AttrInsert commands the the process run without error. I wonder should it be permanently withdrawn.

Thanks.

Kenneth
Steve Rowe wrote: Wed Feb 07, 2018 9:46 am Sounds like you are doing a delete and rebuild to the objects concerned.
This is usually a pretty bad idea, it is much better to clear (data, alias values, structure) and refresh, this avoids issues in the servers object model like the one you have encountered where a rule is flagged as invalid when the object is deleted.

Re: }ElementAttributes Rule and TI conflict

Posted: Wed Feb 07, 2018 2:14 pm
by Drg
Try to use this before

Code: Select all

CubeRuleDestroy(CubeName);
and

Code: Select all

CubeRuleAppend(CubeName, RuleText, IsCalculationRule);
after update dimension with alias

Or create config cube to stet alias rules on time wheen you update dimensionn
example:

Code: Select all

[aliasNameElement] s:= IF( DB(configcube, 'UseRule' , 'DimensionAlias' ) @='DIM_UPDATE' ,STET , your rule to create alias   );

Re: }ElementAttributes Rule and TI conflict

Posted: Wed Feb 07, 2018 2:20 pm
by kenship
Thanks. Will try!

Kenneth
Drg wrote: Wed Feb 07, 2018 2:14 pm Try to use this before

Code: Select all

CubeRuleDestroy(CubeName);
and

Code: Select all

CubeRuleAppend(CubeName, RuleText, IsCalculationRule);
after update dimension with alias

Or create config cube to stet alias rules on time wheen you update dimensionn
example:

Code: Select all

[aliasNameElement] s:= IF( DB(configcube, 'UseRule' , 'DimensionAlias' ) @='DIM_UPDATE' ,STET , your rule to create alias   );

Re: }ElementAttributes Rule and TI conflict

Posted: Wed Feb 07, 2018 2:23 pm
by Drg
I ask you to take into account that CubeRuleDestroy permanently deletes the file. for correct operation, before you perform this function, you must first copy the }elementattribute*.rux file to a temporary folder.
;)

Re: }ElementAttributes Rule and TI conflict

Posted: Wed Feb 07, 2018 2:25 pm
by kenship
Noted. I'll back up and test the Rule append function to make sure.
Drg wrote: Wed Feb 07, 2018 2:23 pm I ask you to take into account that CubeRuleDestroy permanently deletes the file. for correct operation, before you perform this function, you must first copy the }elementattribute*.rux file to a temporary folder.
;)

Re: }ElementAttributes Rule and TI conflict

Posted: Wed Feb 07, 2018 2:37 pm
by ascheevel
kenship wrote: Wed Feb 07, 2018 1:20 pm I suspended the AttrDelete and AttrInsert commands the the process run without error. I wonder should it be permanently withdrawn.
This sounds like your answer right there, don't delete and reinsert the attribute during dimension update and you should be good.

Re: }ElementAttributes Rule and TI conflict

Posted: Wed Feb 07, 2018 3:04 pm
by holger_b
RuleLoadFromFile(Cube, TextFile) could be even quicker if it is just about reinstating the previously deleted rules

Re: }ElementAttributes Rule and TI conflict

Posted: Wed Feb 07, 2018 3:06 pm
by kenship
Yes and exactly what I'm thinking.

Thanks to all!
holger_b wrote: Wed Feb 07, 2018 3:04 pm RuleLoadFromFile(Cube, TextFile) could be even quicker if it is just about reinstating the previously deleted rules