You are not logged in.

Dear visitor, welcome to Palo Community Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

donJaneiro

Intermediate

  • "donJaneiro" started this thread

Posts: 11

Date of registration: Sep 13th 2011

  • Send private message

1

Monday, February 27th 2012, 1:25pm

Attributes in business rules

Hi,

does anybody have a working example of using attribute values in a business rule. The scenario is the following, I have an accounts -dimension with P&L and Balance accounts and I need to calculate roll-ups differently depending on the type of account used. This means that I have an attribute called account_code, which details the type of account used (eg. "p" for P&L and "b" for Balance) and I need to leverage this in a business rule. There is a good working example of semi-additive behavior in this post http://www.jedox.com/community/palo-foru…ditive#post6714 .

If you have any working example of a syntax where you use attributes in business (enterprise) rules, then I would greatly appreciate it if you could post it here. Or, if you know of another post detailing the same problem please refer me to that thread.

Regards,
Henrik

Posts: 217

Date of registration: Dec 2nd 2009

Location: Berlin

Hobbies: Born to work :-)

  • Send private message

2

Wednesday, February 29th 2012, 3:28pm

Hi,

well I do not know whether I understood your problem well, but using an IF-statement it may do the trick:

Source code

1
2
3
4
5
['calculated']=IF(
PALO.DATA("database","#_accounts","account_code",!'accounts")=="b",
calculation for balance accounts,
calculation for p&l accounts
)


actually the syntax for using attr in business rules is really like for any other cube:

Source code

1
PALO.DATA(database,cube,coordinates)

transposed in attr cube:

Source code

1
PALO.DATA(database,#_dim,"attribute","element")
laloune

"To understand recursion, one must understand recursion"

This post has been edited 1 times, last edit by "laloune" (Feb 29th 2012, 3:33pm)


donJaneiro

Intermediate

  • "donJaneiro" started this thread

Posts: 11

Date of registration: Sep 13th 2011

  • Send private message

3

Tuesday, March 6th 2012, 1:09pm

Thanks, this helps!

  • "dmarkovic" is male

Posts: 90

Date of registration: Aug 11th 2011

Location: Vienna / Austria

Occupation: Vector SW DV GmbH

  • Send private message

4

Tuesday, March 6th 2012, 1:43pm

Hello,

transposed in attr cube:

Code source
1
PALO.DATA(database,#_dim,"attribute","element")


like laloune says, it is like every cube.
Info: the attruibutes are not displayed in the rule-editor. You must type it manually.

Regards.
Djordja Markovic
Vector SW DV GmbH

Interessant things:
Internal derby:
http://www.jedox.com/community/palo-foru…14338#post14338
Calculate your cube size:
http://www.jedox.com/community/palo-foru…14406#post14406

donJaneiro

Intermediate

  • "donJaneiro" started this thread

Posts: 11

Date of registration: Sep 13th 2011

  • Send private message

5

Monday, March 12th 2012, 8:47am

...thanks for these answers. The remaining issue I have is, on this setup, I have to enter a business rule for each balance account separately. This is due to the fact that the target area is "static". So, for instance, if I have a business rule that states:
['balance'] = C: IF(AND(PALO.ELEVEL("db", "time", !'time') > 0, PALO.DATA("db", "#_account", "acccode", !'account') == "B"), PALO.DATA("db", "cube", PALO.ECHILD("Tuotekehitys", "time", !'time', PALO.ECHILDCOUNT("db", "time", !'time')), !'account', !'msr'), STET())

Where the account is named balance and another rule for the next account let's say active:

['active'] = C: IF(AND(PALO.ELEVEL("db", "time", !'time') > 0, PALO.DATA("db", "#_account", "acccode", !'account') == "B"), PALO.DATA("db", "cube", PALO.ECHILD("Tuotekehitys", "time", !'time', PALO.ECHILDCOUNT("db", "time", !'time')), !'account', !'msr'), STET())

and so on...

I guess this is an issue with setting up a new dimension for account type, thus being able to create a more general rule, and skipping the attribute idea.

regards,
henrik

kratzer

Master

  • "kratzer" is male

Posts: 87

Date of registration: Feb 23rd 2006

Location: Karlsruhe

Occupation: IT

  • Send private message

6

Monday, March 12th 2012, 6:21pm

Isn't this the general rule?

Source code

1
2
3
4
[] = C: IF(AND(PALO.ELEVEL("db", "time", !'time') > 0, 
PALO.DATA("db", "#_account", "acccode", !'account') == "B"), 
PALO.DATA("db", "cube", PALO.ECHILD("Tuotekehitys", "time", !'time', 
PALO.ECHILDCOUNT("db", "time", !'time')), !'account', !'msr'), STET())


for all accounts with accountcode = B. You only need to define the Else-case for accountcode<> B as laloune proposed.

Similar threads

Rate this thread