Skip to Content
0

Question: How to use Dim Property in Script Logic?

Mar 21, 2017 at 06:26 PM

101

avatar image

Hello Experts,

I have a script logic where I need to use a Dimension Value. My dimensions are:

Category, OP_SUPUESTOS, ZRELACIONCTACEBE, ZSTAGL, CUENTAS, PERIODO, BUILDING WICH ARE STATICS.

In addition I have Sociedad, Ceco, Cebe, Supnom, Moneda

The object of the script is to write values from Company Code (Sociedad ) 1010, to 1050, 1051 or 1052, depending a Value. Also the account changes between Company code 1010 to the 1050's CC.

I have almost all the code, just one detail:

With the next piece of code I get an error in TCODE UJKT:

*FOR %T% = 01.%YR%, 02.%YR%, 03.%YR%, 04.%YR%, 05.%YR%, 06.%YR%, 07.%YR%, 08.%YR%, 09.%YR%, 10.%YR%, 11.%YR%, 12.%YR%
											*FOR %NOM% = SVID, GMED,COVA, DESP, COEM, FOAH, AGUI, PDOM, PRAS, PVAC, SAR0, INFO
									*REC(EXPRESSION=%VALUE%==1050.00? ([SUPNOM].[%NOM%],[PERIODO].[12.2017]):0,CEBE = CECO.C1050, MONEDA = MXN, CECO = CECO.C1050, HOTEL = 0000001050, SOCIEDAD = 1050, SUPNOM = NA_SUPRH, CUENTAS = ([SUPNOM].[%NOM%]).[CUENTA]), PERIODO = %T%)
									*REC(EXPRESSION=%VALUE%==1051.00? ([SUPNOM].[%NOM%],[PERIODO].[12.%YR%]):0,CEBE = CECO.C1051, MONEDA = MXN, CECO = CECO.C1051, HOTEL = 0000001051, SOCIEDAD = 1051, SUPNOM = NA_SUPRH, CUENTAS = ([SUPNOM].[%NOM%]).[CUENTA]), PERIODO = %T%)
									*REC(EXPRESSION=%VALUE%==1052.00? ([SUPNOM].[%NOM%],[PERIODO].[12.%YR%]):0,CEBE = CECO.C1052, MONEDA = MXN, CECO = CECO.C1052, HOTEL = 0000001052, SOCIEDAD = 1052, SUPNOM = NA_SUPRH, CUENTAS = ([SUPNOM].[%NOM%]).[CUENTA]), PERIODO = %T%)
											*NEXT
											*NEXT


the instruction to rec in ([SUPNOM].[%NOM%]).CUENTA is not recognized by the sys.

my dimension SUPNOM HAS A VARIABLE %NOM% , this is TO CHANGE ACCORDING TO THE LIST. (in code).

CUENTA is a property of dimension supnom, but when i run the script in ujkt it seems that doesn't get the SUPNOM Property:

Here is a screenshot of Dimensioin SUPNOM:

I have tried different sintaxis without success:

([SUPNOM].[%NOM%]).CUENTA

([SUPNOM].[%NOM%]).[CUENTA]

AND OTHER COMBINATIONS.

What am I doing wrong in the sintaxis??

Thanks for the posts.

Regards.

supnom.png (23.6 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Vadim Kalinin Mar 21, 2017 at 06:46 PM
1

Where do you read about the syntax like:

([SUPNOM].[%NOM%]).CUENTA???

The only supported syntax is:

SUPNOM.CUENTA

It will use the current value of SUPNOM in the current record and will get the property value.

In general the script is incorrect, but you need to clearly specify the calculation logic to get some help!

Show 7 Share
10 |10000 characters needed characters left characters exceeded

Hello Vadim,

Thank you very much for the post,

I didn't read about the syntaxis, I assumed it cold work, but then based on your comment that only SUPNOM.CUENTA is supported, then I will have to change the logic of the script.

Is there a way to make the SUPNOM DYNAMIC? it is bc I need to check all supnom listed in the script and assign the corresponding account.

Regards.

0

Vadim,

Based on your comment I changed the code. I think this would work. I am testing:

*SELECT(%NOMS%,ID, SUPNOM, ID = SVID, GMED,COVA, DESP, COEM, FOAH, AGUI, PDOM, PRAS, PVAC, SAR0, INFO)


// SUPUESTOS DE NÓMINA CON MONEDA NA Y ESTÁN SOLAMENTE EN EL MES DE DICIEMBRE


	*WHEN SOCIEDAD 
		*IS %SOCIEDAD%
			*WHEN CECO
				*IS %CECOS%
					*WHEN PERIODO
						*IS 12.%YR%
							*WHEN MONEDA 
								*IS NA_MONEDA
									*WHEN SUPNOM
										*IS %NOMS%
											*FOR %T%= 01.%YR%, 02.%YR%, 03.%YR%, 04.%YR%, 05.%YR%, 06.%YR%, 07.%YR%, 08.%YR%, 09.%YR%, 10.%YR%, 11.%YR%, 12.%YR%
												*REC(EXPRESSION=([SUPNOM].[CIAA],[PERIODO].[12.%YR%])==1050.00? %VALUE%:0,CEBE = CECO.C1050, MONEDA = MXN, CECO = CECO.C1050, HOTEL = 0000001050, SOCIEDAD = 1050, SUPNOM = NA_SUPRH, CUENTAS = SUPNOM.CUENTA, PERIODO = %T%)
												*REC(EXPRESSION=([SUPNOM].[CIAA],[PERIODO].[12.%YR%])==1051.00? %VALUE%:0,CEBE = CECO.C1051, MONEDA = MXN, CECO = CECO.C1051, HOTEL = 0000001051, SOCIEDAD = 1051, SUPNOM = NA_SUPRH, CUENTAS = SUPNOM.CUENTA, PERIODO = %T%)
												*REC(EXPRESSION=([SUPNOM].[CIAA],[PERIODO].[12.%YR%])==1052.00? %VALUE%:0,CEBE = CECO.C1052, MONEDA = MXN, CECO = CECO.C1052, HOTEL = 0000001052, SOCIEDAD = 1052, SUPNOM = NA_SUPRH, CUENTAS = SUPNOM.CUENTA, PERIODO = %T%)
											*NEXT
									*ENDWHEN	
							*ENDWHEN
					*ENDWHEN
			*ENDWHEN	
	*ENDWHEN
0

Still not sure about this script!

What is the PERIODO scope?

Why not to scope dimensions using *XDIM_MEMBERSET? Is it default.lgf script?

0

I have 2 parts of the script, the first one makes reference to Data captured by user, the thing is that they capture it just once and I made the template to save the data in december. i.e they capture budgeting salary per year and it is going to be the same all year; they capture it just once and its saved in Dec.2017.

In the second part there is data that need to be planed by month, for example bonuses, holidays, etc. This is planned all year and here is where I use all the year.

But in this first part I use december to fill all the year. :D

0

Sorry, but not clear!

Is it default.lgf script?

0

No, is not default. The user runs the calculation, I didn't include the script scope.

Here is the complete Code:

//Scope


*XDIM_MEMBERSET CATEGORIA = Presupuesto
*XDIM_MEMBERSET OP_SUPUESTOS = NA_SUP
*XDIM_MEMBERSET ZRELACIONCTACEBE = NA_ZREL
*XDIM_MEMBERSET ZSTAGL = NA_ES
*XDIM_MEMBERSET CUENTAS = 0000611010
*XDIM_MEMBERSET HOTEL= %HOTEL_SET%
*XDIM_MEMBERSET PERIODO=%PERIODO_SET%
//Selección de año
*SELECT(%YRS%, YEAR,"PERIODO", ID = %PERIODO_SET%)
*SELECT(%MNTH12%, ID,"PERIODO",YEAR= %YRS% AND PERIOD = DEC)
*SELECT(%YR%,YEAR, "PERIODO", ID = %MNTH12%)


//Limitar SOCIEDAD Y CECOS
	*SELECT(%SOCIEDAD%, ID ,SOCIEDAD, ID =1010, 1020, 1030 )
	*SELECT(%CECOS%, ID ,CECO, COMP_CODE =%SOCIEDAD% AND CNOM= "H")


*SELECT(%NOMS%,ID, SUPNOM, ID = SVID, GMED,COVA, DESP, COEM, FOAH, AGUI, PDOM, PREMIO A, PVAC, SAR0, INFO, INGR, INCENTIVO FI, AYUDA R, VALES GAS)
*SELECT(%NOMS1%,ID, SUPNOM, ID = GRATIF, COMS, CEXT, IMSS, INOM, DFES, TEXT)


// SUPUESTOS DE NÓMINA CON MONEDA NA Y ESTÁN SOLAMENTE EN EL MES DE DICIEMBRE


	*WHEN SOCIEDAD 
		*IS %SOCIEDAD%
			*WHEN CECO
				*IS %CECOS%
					*WHEN SUPNOM
						*IS %NOMS%
							*WHEN PERIODO 
								*IS 12.%YR%
									*WHEN MONEDA
										*IS NA_MONEDA
											*FOR %T%= 01.%YR%, 02.%YR%, 03.%YR%, 04.%YR%, 05.%YR%, 06.%YR%, 07.%YR%, 08.%YR%, 09.%YR%, 10.%YR%, 11.%YR%, 12.%YR%
												*REC(EXPRESSION=([SUPNOM].[CIAA],[PERIODO].[12.%YR%])==1050.00? %VALUE%:0,CEBE = CECO.C1050, MONEDA = MXN, CECO = CECO.C1050, HOTEL = 0000001050, SOCIEDAD = 1050, SUPNOM = NA_SUPRH, CUENTAS = SUPNOM.CUENTA, PERIODO = %T%)
												*REC(EXPRESSION=([SUPNOM].[CIAA],[PERIODO].[12.%YR%])==1051.00? %VALUE%:0,CEBE = CECO.C1051, MONEDA = MXN, CECO = CECO.C1051, HOTEL = 0000001051, SOCIEDAD = 1051, SUPNOM = NA_SUPRH, CUENTAS = SUPNOM.CUENTA, PERIODO = %T%)
												*REC(EXPRESSION=([SUPNOM].[CIAA],[PERIODO].[12.%YR%])==1051.00? %VALUE%:0,CEBE = CECO.C1052, MONEDA = MXN, CECO = CECO.C1052, HOTEL = 0000001052, SOCIEDAD = 1052, SUPNOM = NA_SUPRH, CUENTAS = SUPNOM.CUENTA, PERIODO = %T%)
											*NEXT
									*ENDWHEN	
							*ENDWHEN
						*IS %NOMS1%
//Supuestos en todos los meses con moneda MXN
							*WHEN MONEDA
								*IS MXN
									*REC(EXPRESSION=([SUPNOM].[CIAA],[PERIODO].[12.%YR%],[MONEDA].[NA_MONEDA])==1050.00? %VALUE%:0,CEBE = CECO.C1050, CECO = CECO.C1050, HOTEL = 0000001050, SOCIEDAD = 1050, SUPNOM = NA_SUPRH, CUENTAS = SUPNOM.CUENTA)
									*REC(EXPRESSION=([SUPNOM].[CIAA],[PERIODO].[12.%YR%],[MONEDA].[NA_MONEDA])==1051.00? %VALUE%:0,CEBE = CECO.C1051, CECO = CECO.C1051, HOTEL = 0000001051, SOCIEDAD = 1051, SUPNOM = NA_SUPRH, CUENTAS = SUPNOM.CUENTA)
									*REC(EXPRESSION=([SUPNOM].[CIAA],[PERIODO].[12.%YR%],[MONEDA].[NA_MONEDA])==1052.00? %VALUE%:0,CEBE = CECO.C1052, CECO = CECO.C1052, HOTEL = 0000001052, SOCIEDAD = 1052, SUPNOM = NA_SUPRH, CUENTAS = SUPNOM.CUENTA)
							*ENDWHEN
					*ENDWHEN
			*ENDWHEN
*ENDWHEN



If you see the code is 2 parts. In the first part, Data is just in December and with currency, NA_MONEDA. In the second part the data is in months Jan to Dec and with currency MXN.

The functional explanation is:

I have Payroll in company 1010 (for instance) and I need to move it to company 1050. I have a payment concept X, wich is capture just once but effective all the year. For capture purposes it is capture just one time (I save it in December). In the other hand I have payment concept y wich needs monthly planning because every month is different and not equal all monts as X concept:

Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec

X concept 1,300 <---- (Value is just stored in DEC but efective for all year )

Y concept 100 101 140 120 110 111 111 111 112 140 120 99 <-------- Value is store in all months

For reporting purposes I have concept Z that has for Jan to Dec 1,300 + concept y. So this means payment for company 1010 is store in 1 dimension member. and is not possible to see the detail (Company 1010 doess't need the detail)

For company 1050 we need to see the detail, plus is store in different account that company 1010. To do this concept x and concept y has a property called CUENTA wich means the account that we need to store the value. Additional to that I need to save the 1,300 from Jan to Dec for concept X and the valu for each month for concept y.

So far I have tested the code and seems to work fine. :D.

Thank you very much for your posts and orientation, the comment that the syntaxis I was trying is not supported helped me a lot to change the logic and make the code Work.

0

The same code in more readable form:

//Selección de año
*SELECT(%YRS%, YEAR,"PERIODO", ID = %PERIODO_SET%)
*SELECT(%MNTH12%, ID,"PERIODO",YEAR= %YRS% AND PERIOD = DEC)
*SELECT(%YR%,YEAR, "PERIODO", ID = %MNTH12%)
//Limitar SOCIEDAD Y CECOS
*SELECT(%SOCIEDAD%, ID ,SOCIEDAD, ID =1010, 1020, 1030 )
*SELECT(%CECOS%, ID ,CECO, COMP_CODE =%SOCIEDAD% AND CNOM= "H")
*SELECT(%NOMS%,ID, SUPNOM, ID = SVID, GMED,COVA, DESP, COEM, FOAH, AGUI, PDOM, PREMIO A, PVAC, SAR0, INFO, INGR, INCENTIVO FI, AYUDA R, VALES GAS)
*SELECT(%NOMS1%,ID, SUPNOM, ID = GRATIF, COMS, CEXT, IMSS, INOM, DFES, TEXT)

*XDIM_MEMBERSET CATEGORIA = Presupuesto
*XDIM_MEMBERSET OP_SUPUESTOS = NA_SUP
*XDIM_MEMBERSET ZRELACIONCTACEBE = NA_ZREL
*XDIM_MEMBERSET ZSTAGL = NA_ES
*XDIM_MEMBERSET CUENTAS = 0000611010
*XDIM_MEMBERSET HOTEL= %HOTEL_SET%
*XDIM_MEMBERSET PERIODO=%PERIODO_SET%
*XDIM_MEMBERSET SOCIEDAD=%SOCIEDAD%
*XDIM_MEMBERSET CECO=%CECOS%

// SUPUESTOS DE NÓMINA CON MONEDA NA Y ESTÁN SOLAMENTE EN EL MES DE DICIEMBRE
*WHEN SUPNOM
*IS %NOMS%
    *WHEN PERIODO 
    *IS 12.%YR%
        *WHEN MONEDA
        *IS NA_MONEDA
            *FOR %T%= 01.%YR%, 02.%YR%, 03.%YR%, 04.%YR%, 05.%YR%, 06.%YR%, 07.%YR%, 08.%YR%, 09.%YR%, 10.%YR%, 11.%YR%, 12.%YR%
                *REC(EXPRESSION=([SUPNOM].[CIAA],[PERIODO].[12.%YR%])==1050.00? %VALUE%:0,CEBE = CECO.C1050, MONEDA = MXN, CECO = CECO.C1050, HOTEL = 0000001050, SOCIEDAD = 1050, SUPNOM = NA_SUPRH, CUENTAS = SUPNOM.CUENTA, PERIODO = %T%)
                *REC(EXPRESSION=([SUPNOM].[CIAA],[PERIODO].[12.%YR%])==1051.00? %VALUE%:0,CEBE = CECO.C1051, MONEDA = MXN, CECO = CECO.C1051, HOTEL = 0000001051, SOCIEDAD = 1051, SUPNOM = NA_SUPRH, CUENTAS = SUPNOM.CUENTA, PERIODO = %T%)
                *REC(EXPRESSION=([SUPNOM].[CIAA],[PERIODO].[12.%YR%])==1051.00? %VALUE%:0,CEBE = CECO.C1052, MONEDA = MXN, CECO = CECO.C1052, HOTEL = 0000001052, SOCIEDAD = 1052, SUPNOM = NA_SUPRH, CUENTAS = SUPNOM.CUENTA, PERIODO = %T%)
            *NEXT
        *ENDWHEN    
    *ENDWHEN
*IS %NOMS1%
        *WHEN MONEDA //Supuestos en todos los meses con moneda MXN
        *IS MXN
                *REC(EXPRESSION=([SUPNOM].[CIAA],[PERIODO].[12.%YR%],[MONEDA].[NA_MONEDA])==1050.00? %VALUE%:0,CEBE = CECO.C1050, CECO = CECO.C1050, HOTEL = 0000001050, SOCIEDAD = 1050, SUPNOM = NA_SUPRH, CUENTAS = SUPNOM.CUENTA)
                *REC(EXPRESSION=([SUPNOM].[CIAA],[PERIODO].[12.%YR%],[MONEDA].[NA_MONEDA])==1051.00? %VALUE%:0,CEBE = CECO.C1051, CECO = CECO.C1051, HOTEL = 0000001051, SOCIEDAD = 1051, SUPNOM = NA_SUPRH, CUENTAS = SUPNOM.CUENTA)
                *REC(EXPRESSION=([SUPNOM].[CIAA],[PERIODO].[12.%YR%],[MONEDA].[NA_MONEDA])==1052.00? %VALUE%:0,CEBE = CECO.C1052, CECO = CECO.C1052, HOTEL = 0000001052, SOCIEDAD = 1052, SUPNOM = NA_SUPRH, CUENTAS = SUPNOM.CUENTA)
        *ENDWHEN
*ENDWHEN


1