Skip to Content
0
Jan 17, 2017 at 01:01 AM

Simulating Hierarchy Script Logic Que

78 Views

Hello Experts, I have a requirement where I have to create an account (well some acconts) and simulate that the new created Account is a Hierarchy. I Don't create a Hierarcy because that new account must be at base level. I have tried different ways to group the values that are suppoused to get saved in that account.

1. My first condition is that the Accounts that has the property HABS and Property zl4ceco get to the account LODGING EXPENSES.

2. The second condition is also the accounts that ID: 0000656003,0000656004,0000656005,0000656007 and property in Dimension CECO zl4ceco must be saved also inLODGING EXPENSES.

I have tried the next scripts so far:

*WHEN PF_CUENTAS.HAB
   *IS "Y"
    *WHEN PF_CECO.ZL4CECO
      *IS "1201"
         *REC(EXPRESSION= %VALUE%, PF_CUENTAS= LODGING EXPENSES, PF_CEBE= NA_CEBE, PF_CECO=NA_CECO, SOCIEDAD=NA_CCC)
    *ENDWHEN

*WHEN PF_CUENTAS
*IS 0000656003,0000656004,0000656005,0000656007
*WHEN PF_CECO.ZL4CECO
*IS 4701
*REC(EXPRESSION= %VALUE%, PF_CUENTAS= LODGING EXPENSES, PF_CEBE= NA_CEBE, PF_CECO=NA_CECO, SOCIEDAD=NA_CCC)
*ENDWHEN
*ENDWHEN
*ENDWHEN

Also tired with a for:

*SELECT (%HABS%, ID, PF_CUENTAS, HAB="Y"
*For %HAB%= %HABS%, 0000656003,0000656004,0000656005,0000656007
 *WHEN PF_CUENTAS
   *IS %HAB%
      *WHEN PF_CUENTAS.HAB
         *IS "Y"
           *WHEN PF.CECO.ZL4CECO
            *IS "1201"
              *REC(EXRPESSION= %VALUE%, PF_CUENTAS= LODGING EXPENSES, PF_CEBE= NA_CEBE, PF_CECO= NA_CECO, SOCIEDAD= NA_CCC)
            *ENDWHEN
      *ELSE
           *WHEN PF_CECO.ZL4CECO*IS "4701"
            *REC(EXRPESSION= %VALUE%, PF_CUENTAS= LODGING EXPENSES, PF_CEBE= NA_CEBE, PF_CECO= NA_CECO, SOCIEDAD= NA_CCC)
           *ENDWHEN
      *ENDWHEN
*ENDWHEN
*NEXT

Also tied something like:

// Costo de Habitaciones
*WHEN PF_CUENTAS.HAB
*IS "Y"
*WHEN PF_CECO.ZL4CECO
*IS "1201"
*REC(EXPRESSION= %VALUE%, PF_CUENTAS= LODGING EXPENSES, PF_CEBE= NA_CEBE, PF_CECO=NA_CECO, SOCIEDAD=NA_CCC)
*ENDWHEN

*WHEN PF_CUENTAS
*SELECT (%HABS%, ID, PF_CUENTAS, ID= 0000656003,0000656004,0000656005,0000656007) 
*IS LODGING EXPENSES
*WHEN PF_CECO
*IS NA_CECO
*REC(EXPRESSION= (%VALUE% +  [PF_CUENTAS].[%HABS%])=  PF_CEBE= NA_CEBE, PF_CECO=NA_CECO, SOCIEDAD=NA_CCC)
*ENDWHEN
*ENDWHEN
*ENDWHEN

I have tried other many ways but I don't get to save all the values in the account. Some cases I got saved just the 1 condition, sometimes the 2nd condition overwrites the 1st. What Am I doing wrong? Any suggestions?? any ideas??

Thanks for the posting.