Quantcast
Channel: SCN : Discussion List - SAP Planning and Consolidation, version for the Microsoft platform
Viewing all articles
Browse latest Browse all 1545

My script is double counting accounts

$
0
0


I'm trhing to create a script that multiplies a sum of separate accounts by a single value. But my script is multiplying by the value times the number of accounts it finds.

 

What I want is (AccounttA = 20 + AccountB = 50)

Multiply the sum - 70 times 10%  --- should be 7.

 

Instead, I get double that 14... where there are 2 accounts, 21 where there 3 accounts and so on.

 

Here's my fauly script:

 


*XDIM_MEMBERSET  TIME=2015.JAN,2015.DEC

*XDIM_MEMBERSET CATEGORY=BUDGETWORKING

*XDIM_MEMBERSET  DATASRC=INPUTORLOAD

*XDIM_MEMBERSSET  RPTCURRENCY=USD

*XDIM_MEMBERSET JOBTITLE=<ALL>

*XDIM_MEMBERSET PAYACCOUNT=SALARYBASEPAY,HEADCOUNTFTE,CASHPERKSPAY,OVERTIMEPAY,REGULAR_BONUS,HOLIDAY_BONUS,NONUNIONMERITPAY,UNIONMERITPAY,CASHRECOGPAY,EXECLIFE,EXECSTOCKOPTIONS,EXECSTOCKGRANT,COMMISSIONPAY,WAGE_SAL_ADJ

*XDIM_MEMBERSET PAYPOSITION=<ALL>

*SDIM_MEMBERSET SEGMENT=NO_SEG

*XDIM_MAXMEMBERS  PAYORG = 300

 

 

*OLAPLOOKUP PAYROLL

*DIM TAXFAC:PAYACCOUNT="CCPAYTAXRATE"

*DIM TAXFAC:SCENARIO="BASELINE"

*DIM TAXFAC:PAYPOSITION="P_NOPOSITION"

*DIM  TAXFAC:COMPANY="NO_COMPANY"

*DIM TAXFAC:JOBTITLE="NOTITLE"

*ENDLOOKUP

 

 

*WHEN SCENARIO

*IS BASELINE


    *WHEN PAYORG.INT_PLAN_TYPE

     *IS<> "QW_INTL"


         *WHEN TIME.TIMEID

          *IS>= CATEGORY.OPENING_TIMEID


                *WHEN TIME.TIMEID

                 *IS<= CATEGORY.ENDING_TIMEID


                        *WHEN PAYPOSITION

                         *IS "P_JOBTITLE_POSITION"

 

*REC(PAYACCOUNT=PayTaxExpense,COMPANY=PAYORG.COMPANY,EXPRESSION= LOOKUP(TAXFAC)   *  (GET(PAYACCOUNT="CASHPERKS")  + GET(PAYACCOUNT="SALARYBASE") + GET(PAYACCOUNT = "MERITPAY"))

                         *ELSE

                         *ENDWHEN

 

*REC(PAYACCOUNT=PayTaxExpense,COMPANY=PAYORG.COMPANY,EXPRESSION= LOOKUP(TAXFAC) * (GET(PAYACCOUNT="PENSION")  + GET(PAYACCOUNT="WAGE_SAL_ADJ") +GET(PAYACCOUNT = "OVERTIMEPAY))

                      *ENDWHEN

                *ENDWHEN

             *ENDWHEN

        *ENDWHEN

*COMMIT

 

So if the TaxFac is 10% and there is only CashPerks of $100, the code write $10 correctly.

But if there is $50 CashPerks and $50 Salarybase, the code write out $20 ( because of the number of accounts)

If there are 3 accounts, each with $33.33..CashPerks, Salarybase and Merit, the code writes $30 and so on.

 

What am I doing wrong?

 

Your help is very much appreciated.

 

 

 

 

 

 

 

 



Viewing all articles
Browse latest Browse all 1545

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>