cancel
Showing results for 
Search instead for 
Did you mean: 

Logic Script Tupple question

former_member182305
Active Participant
0 Kudos

Hi Experts,

I am struggling with a Logic, I need to multiply the values of each Cost Center with an indicator (actually is to get an average of x months where the account DIVISOR was capture with the number of months to be use as divisor). In my model I have the next dimensions:

  • PRODUCT
  • ACCOUNT
  • COST CENTER
  • REQUESTOR
  • TIME
  • CUSTOMER
  • VERSION
  • COMPANY
  • AUDIT
  • CURRENCY

The data I want to multiply (divide) is as next:

want to multiply the first 3 records with the same last one so I am doing a Logic using tuples,

I have the next Logic:

*SELECT (%COST_CENTERS%, ID, COST_CENTER, VAR_A<>' ') 

*XDIM_MEMBERSET COST_CENTER= %COST_CENTERS%, NO_COSTCENTER
*XDIM_MEMBERSET CUSTOMER= NO_CUSTOMER
*XDIM_MEMBERSET ACCOUNT= BAS(VAR_A), DIVISOR
*XDIM_MEMBERSET CURRENCY= NO_CURRENCY
*XDIM_MEMBERSET AUDIT= INPUT, CALC
*XDIM_MEMBERSET PRODUCT= NO_PRODUCT
*XDIM_MEMBERSET REQUESTOR= NO_REQUESOTR
*XDIM_MEMBERSET TIEMPO= BAS(2021.12)
*XDIM_MEMBERSET VERSION= REAL

*FUNCTION MONTHS=([COST_CENTER].[NO_COST_CENTER], [CUSTOMER].[NO_CUSTOMER],[ACCOUNT].[DIVISOR],[CURRENCY].[NO_CURRENCY],[AUDIT].[INPUT],[PRODUCT].[NO_PRODUCT],[TIME].[2021.12],[REQUESTOR].[NO_REQUESTOR],[VERSION].[REAL])

	*WHEN ACCOUNT
		*IS COST_CENTER.VAR_A
			*REC(FACTOR=%VALUE%/MONTHS, ACCOUNT=AVERAGE_VAR, TIME=2021.12)
	*ENDWHEN
I have VAR_A as property of Cost Center where I have the related account where I want to save the data for each Cost Center. The issue with the script is that when I set %VALUE% tha value taken is the same as the Tuple. Do you see any mistakes in my code?

Thanks in advance.

Best Regards.

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member182305
Active Participant
0 Kudos

Hi everyone, I got the mistake. It was a silly mistake, I was missing [COMPANY].[NO_COMPANY] in the Tuple expression.

I am saving my inidcator, or actually the # of months that will be the divisor in NO_COMPANY, and the data to be divided by is in 000COMANPY, so at the moment to divide the COMPANY member was not the same or specified in the Tuple

Thanks

Regards.