cancel
Showing results for 
Search instead for 
Did you mean: 

Script Logic with several dimensions' condition

Former Member
0 Kudos

Hi everyone.

I'm new to BPC Script Logic and I have general question, regarding Script Logic structure. Here is my scenario:

1. There are several (from 2 to 7) expansions in Rows. In my case lets say there are 2 expansions called "Account" and "CostCenter"

2. In expansion "Account" there is one account called "Administration Employees", which will be calculated via Script Logic

3. "Administration Employees" account will take data from expansion "Account", account called "Total Employees", while second expansion "CostCenter" attribute "TYPE" will be equal "Administration"

In general it should look like this: "Administration Employees" = SUM (Account = "Total Employees", while Costcenter.TYPE = "Administration). There will be like from 100 to 200 data lines, which will meet this conditions.

Could you please tell me how to write this, at least in general way.

Thank You!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

If i understand your requirement correctly, what exactly you need is to sum the values available for all Total Employees account where CostCenter attribute TYPE equal to Administration and post the value into Administration Employees account.

if this is the case there should be a value for the cost center of Administration Employees account to save the total value. I consider that costcenter value as TEST.

So your script will be as follows,


*WHEN ACCOUNT
*IS "Total_Employees"
*WHEN COSTCENTER.TYPE
*IS "Administration"
*REC(COSTCENTER=TEST,ACCOUNT,ACCOUNT=Administration_Employees)
*ENDWHEN

Hope this helps,

Regards,

G.Vijaya Kumar

Former Member
0 Kudos

Hi G.Vijaya Kumar,

will this approach help me with this setting:

Account | CostCenter

__________________________

Total Employee | CostCenter 1

__________________________

Total Employee | CostCenter 2

__________________________

Total Employee | CostCenter3

CostCenter 2 and CostCenter 3 attribute TYPE = u201CAdministrationu201D

Account |CostCenter

___________________

Administration Employees |CostCenter 4| = (Total Employee,CostCenter 2 + Total Employee, Cost Center 3)

___________________________________

Edited by: StanisIav Antanaytis on Jan 27, 2011 3:14 PM

Edited by: StanisIav Antanaytis on Jan 27, 2011 3:15 PM

Former Member
0 Kudos

Hi,

Yes this works for you, just fine tune my script with Costcenter TEST with Costcenter 4 and that should work.

If you are running this logic via DM package then make sure you send the scope for Account and Cost Center through DM prompts so that the logic within the When statement gets executed.

If you are running the logic via Default logic, you need to send data for the Account's and CostCenter's in When statement else the logic will not get executed.

by including the below scoping commands you can execute the logic whenever any data is sent (When in Default logic File) or without Prompt via DM,

*XDIM_MEMBERSET ACCOUNT = Total Employee

*XDIM_MEMBERSET COSTCENTER = BAS(<<Parent of all Cost Center>>)

<< Code>>

Hope this helps,

Regards,

G.Vijaya Kumar

Former Member
0 Kudos

Dear G.Vijaya Kumar,

Thanks a lot for your help. In my case it will have 7 expansions at a time, but I think it won't change the concept, which you advised me 😃

Regards

Stanislav Antanaytis

Answers (1)

Answers (1)

Former Member
0 Kudos

Dear G.Vijaya Kumar

I tried it, but it didn't work.

*XDIM_MEMBERSET Account = "Total Employee"
*XDIM_MEMBERSET CostCenter = BAS("ALL_COSTCENTER")
*WHEN Account
*IS "Total Employee"
*WHEN CostCenter.TYPE
*IS "Administration"
*REC(CostCenter="CostCenter 4",Account,Account="Administration Employee")
*ENDWHEN
*ENDWHEN

I tried with "" and without it. If it will help "ALL_EMPLOYEE", "Total Employee", "CostCenter4" and "Administration Employee" are not IDs, but EVDESCRIPTION. Should I put IDs or EVDESCRIPTION is fine?

Also I have time dimension in columns.

Former Member
0 Kudos

Hi,

First thing is that you need mention the IDs and not the EVDRESCRIPTION.

The first XDIM statement has evdescription in it. The REC statement also has evdescription. Please change them to ID.

Your code should be like this:

*XDIM_MEMBERSET Account = ID of Total Employee
*XDIM_MEMBERSET CostCenter = BAS("ALL_COSTCENTER")
*WHEN Account
*IS *
   *WHEN CostCenter.TYPE
   *IS "Administration"
      *REC(CostCenter="CostCenter 4", Account= ID of Administration Employee)
   *ENDWHEN
*ENDWHEN

Hope this helps.

Former Member
0 Kudos

Hi,

Yes as mentioned by Nilanjan, for specifiying any account you need to use its ID rather description.

So your code should be like this, (With few changes in Nilanjan code)



*XDIM_MEMBERSET Account = <<ID of Total Employee>>
*XDIM_MEMBERSET CostCenter = BAS(<<ID of Parent of ALL COSTCENTER>>)
*WHEN Account
*IS "<<ID of Total Employee>>"
*WHEN CostCenter.TYPE
*IS "Administration"
*REC(CostCenter="<<ID of CostCenter 4>>",Account="<<Id of Administration Employee>>")
*ENDWHEN
*ENDWHEN

Hope this helps,

Regards,

G.Vijaya Kumar

Former Member
0 Kudos

Hi guys, this code I'm trying to implement. Here I have 7 dimension expansions in rows (in columns I have 2 dimensions). However, it doesn't work. All IDs which end with "1" are main parents of dimension.

*XDIM_MEMBERSET P_ACCT = PAC30070
*XDIM_MEMBERSET COSTCENTER = BAS(CCN1)
*XDIM_MEMBERSET WORKSHOP_LINE = BAS(WSL1)
*XDIM_MEMBERSET PARTNER = BAS(PRN1)
*XDIM_MEMBERSET RESOURCE_TYPE = BAS(RTT1)
*XDIM_MEMBERSET STOCK_CATEGORY = BAS(STC1)
*XDIM_MEMBERSET SALE_PROJECT = BAS(SLP1)
*WHEN WORKSHOP_LINE
*IS "WSL2"
*WHEN PARTNER
*IS "PRN2"
*WHEN RESOURCE_TYPE
*IS "RTT2"
*WHEN STOCK_CATEGORY
*IS "STC2"
*WHEN SALE_PROJECT
*IS "SLP2"
*WHEN P_ACCT
*IS "PAC30070"
	*WHEN COSTCENTER.TYPE
	*IS "Administration" OR "General"
		*REC(COSTCENTER= "CCN2", WORKSHOP_LINE = "WSL2", PARTNER = "PRN2", RESOURCE_TYPE = "RTT2", STOCK_CATEGORY = "STC2", SALE_PROJECT = "SLP2", P_ACCT="PAC30072")
	*ENDWHEN
*ENDWHEN
*ENDWHEN
*ENDWHEN
*ENDWHEN
*ENDWHEN
*ENDWHEN

Edited by: StanisIav Antanaytis on Jan 28, 2011 11:32 AM

Former Member
0 Kudos

Hi,

First of all, are the members ending with 2 are children of 1?

Former Member
0 Kudos

Yes, they are.

The structure is:

ID1 is main parent, ID2 and ID3 are his children, while ID3 has a lot children. In this case, for example, PAC30070 and PAC30072 are children of PAC3, which is child of PAC1, which has PAC2 and PAC3 as children. situation like this.

Former Member
0 Kudos

Hi,

What i understand from your code is WSL2,PRN2,RTT2,STC2,SLP2 are all base members.

So make your script as follows,


*XDIM_MEMBERSET WORKSHOP_LINE = WSL2
*XDIM_MEMBERSET PARTNER = PRN2
*XDIM_MEMBERSET RESOURCE_TYPE = RTT2
*XDIM_MEMBERSET STOCK_CATEGORY = STC2
*XDIM_MEMBERSET SALE_PROJECT = SLP2
*XDIM_MEMBERSET P_ACCT = PAC30070

*WHEN P_ACCT
*IS "PAC30070"
	*WHEN COSTCENTER.TYPE
	*IS "Administration","General"
		*REC(COSTCENTER= "CCN2", WORKSHOP_LINE = "WSL2", PARTNER = "PRN2", RESOURCE_TYPE = "RTT2", STOCK_CATEGORY = "STC2", SALE_PROJECT = "SLP2", P_ACCT="PAC30072")
	*ENDWHEN
*ENDWHEN

Note:

Make a note of , which i have used to replace OR.

What I advice you is to go step by step rather writting a bigger code at a stretch which helps you learn many informations which we havent provided you.

Hope this helps,

Regards,

G.Vijaya Kumar

Former Member
0 Kudos

Dear G.Vijaya Kumar,

thank you for you support. I rechecked everything and added some condition and it works just fine 😃

I wish I could start from easy tasks, but project is running fast and I need to learn Script Logic as fast as possible 😃

Kind Regards

Stanislav Antanaytis