Skip to Content
0
Jan 27, 2022 at 04:56 PM

Logic Script Tupple question

122 Views Last edit Jan 27, 2022 at 05:14 PM 3 rev

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:

image.png

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.

Attachments

image.png (14.9 kB)
image.png (15.4 kB)
image.png (15.4 kB)