Script Logic to Calculate average or sum based on parent member involving

Hi ! freinds,
I am trying to write script logic to calclate
sum  of previous 2 months for  one group account having 100 childrens and write to DIFFERENT INPUT ACCOUNT . Please suggest the best practive to calculate the value.
I tried with : *WHEN *IS / *ENDWHEN  its is not possible to define
when ACCT
is BAS(Group Account)----
NOT SUPPORTED
Rec .....
ENDWHEN
Please help

Vishwanath,
Are you trying to calculate an average by account for the two months or an average of all accounts?
Ex 1
          Feb   Mar  Avg
acct1 1000   500   750
acct2 1000  1000 1000
Ex2
         Feb   Mar
acct1 1000   500
acct2 1000  1000
Avg 1000   750
Akos

Similar Messages

  • Script logic to calculate average value on nodes - SAP BPC NW 10.0

    Hi experts,
    I need to have in the parent members of the dimension TIME (2014.Q1, 2014.Q2,  2014.Q3, 2014.Q4, 2014.TOTAL) the average value of  their children and not the sum. For example :
    2014.01        2014.02         2014.03        2014.Q1
        1                  2                    3                  2                                          
    2 = AVG(1, 2, 3)
    I tried the script bellow but it doesn't work , it throws the error " ReferenceError : AVG is not defined"
    *SELECT(%TIMESET%,"[ID]",TIME,"[CALC]='Y'")
    *XDIM_MEMBERSET TIME = %TIMESET%
    *XDIM_MEMBERSET MEASURES = PERIODIC
    *WHEN DIM1
    *IS C02
    *WHEN TIME
    *IS %TIMESET%
    *REC(EXPRESSION = AVG(Descendants([%TIMESET%].CURRENTMEMBER)), TIME = %TIMESET%)
    *ENDWHEN
    *ENDWHEN
    *COMMIT
    How can I achieve this ?
    Thanks
    Maha

    The best way is to enter 2 accounts: Productivity and Area, calculating by dimension member formula:
    ProductivityPerHectare=IIF([Area]=0,NULL,[Productivity]/[Area])
    If you have to enter ProductivityPerHectare and Area, then in script you can calculate Productivity:
    *WHEN ACCOUNT
    *IS Area
    *REC(EXPRESSION=%VALUE%*[ACCOUNT].[ProductivityPerHectare],ACCOUNT=Productivity)
    *ENDWHEN
    *WHEN ACCOUNT
    *IS ProductivityPerHectare  //user input
    *REC(EXPRESSION=%VALUE%*[ACCOUNT].[Area],ACCOUNT=Productivity)
    *ENDWHEN
    Then dimension member formula:
    ProductivityPerHectareCalc=IIF([Area]=0,NULL,[Productivity]/[Area])
    You can use arithmetic average of ProductivityPerHectare only if Area is always constant.
    In this case you can create some dummy account member DUMMY and fill it with 1:
    *WHEN ACCOUNT
    *IS ProductivityPerHectare  //user input
    *REC(EXPRESSION=1,ACCOUNT=DUMMY)
    *ENDWHEN
    Then dimension member formula:
    ProductivityPerHectareCalc=IIF([DUMMY]=0,NULL,[ProductivityPerHectare]/[DUMMY])
    Vadim

  • Logic to calculate average number of employees per day...

    Hi,
    In an internal table, i have employee number, start date, end date.
    This table shows employee's start and end dates for a cost center.
    Now, the requirement is to calculate the average number of employees available per day for a given period...
    Lets asume that we would like to calculate average number of employees per day for a given period of 30 days (01.01..2009 to 30.01.2009)....
    The above table will have around 20 employees with their start and end date.
    Among these 20, some may be present between 1st to 10th Jan only..
    In such case, How to calculate average number of employees per day in such case?
    Can anyone help me out with a rough sketch of logic for this calculation?
    Thanks in Advance,
    Pavan

    My Logic:
    1) First choose dates from which date to which date you are planning to calculate. [Here i am trying to calculate from Jan 1st 2008 to till date - March 3rd 2009 = So total days = 427 days]
    2) First try to count number of days worked in organization by each employee. [Lets take employee a = 10 days, b = 182 days, c = 427 days].
    3) Then total all the number of days. [abc = 10182427 = 619 days].
    4) Total number days / Total number of days worked = 619 / 427 =  1.44 employees per day.
    Employee     Emp-Start Date     Emp-End Date     No. of days
    a             Jan 1st 2008     Jan 10th 2008     10
    b             Jun 1st 2008     Jun 30th 2008     182
    c            Jan 1st  2008     3rd March 2009     427
              Total No. of days                     619
         From Jan1st 2008 to Till date 3rd March 09          427
              619 / 427 =     1.449648712
    I tried take simple example to recheck the above scenario is correct or not. If 'n' number of employees worked for an organization in a year (365 days) is 730. then per day = 730 / 365 = 2 employees per day worked for organization.
    I am not sure my logic is correct or not ... just tried like above.
    Regards,
    ~Satya

  • Script Logic - Amount Condition

    Hi all,
    I want to create a script logic that calculates a new account based in another account. For example, i have the account XXX and the account YYY.
    In Pseudocode my condition is:
    If Account XXX < $2500
    then Account YYY= 100;
    How can i create a script logic that executes my pseudocode?
    Thanks.
    Regards,
    Jorge

    Hi,
    For your example, you can try
    *WHEN GET(ACCOUNT = "XXX")
    *IS < 2500
       *REC(EXPRESSION = 100, ACCOUNT = YYY)
    *ENDWHEN
    *COMMIT
    To know more about the when statements, please go to the following link
    http://help.sap.com/saphelp_bpc75/helpdata/en/a5/719a63b6fa4ef0964d11d69c607803/content.htm
    Hope this helps.

  • Reg: Selectively Commenting Script Logic

    Dear Experts,
    I have a situation where in the Default Logic file comprises of Allocation Logic and Currency Translation Logic, and it works fine.
    But for just one of my reports I have created an Data manager package for Allocation as it uses a different Dimension (Datasource dim instead of Product dim) when compared with the others (which are allocated based on Product).
    The allocation logic works fine if and only if i comment the Allocation Logic present in the Default logic file but this will prohibit the allocation in the remaining reports.
    Is there a way i can restrict the Allocation present in default logic and run only the manually triggered allocation without commenting in default logic so that it works fine for other reports as well.
    Please advice.
    Rgds,
    Rizwan

    I'm a little confused by your use of the word "reports." In BPC, I use the word "report" to mean something very simple -- a view into the data that is stored in the database.
    Any script logic that calculates values (for example, allocations or currency conversion) will post its results to the database. Once those results are in the database, any and all reports which point to those values will retrieve the same result. So it's not possible to have one report retrieve values that are impacted by a data manager package, while other reports ignore that data manager package.
    (However, as soon as I say that, I'll disagree with myself and say, yes of course it's possible -- in the most extreme case, create separate applications for the different business requirements. Or more frequently, use different members in datasrc or some other dimension to isolate the different values.)
    To solve your problem, you need to approach it in terms of the cube (OLAP) data structure, and then your final reports need to either include or exclude, as appropriate, the allocation results. I would recommend you not think in terms of making the code branch in different directions (based on some or other reports). Instead, the logic runs all the time, and the question should be, where do the logic results post to?
    For a very simple example, the currency conversion results always post to USD, EUR, etc. members of the RptCurrency dimension. This logic will never change the original (LC) values.
    For your allocation logic, the same approach can apply. Obviously you wouldn't use the RptCurrency dimension to differentiate the results, but perhaps a datasrc dimension (or something similar) can achieve the result you need.
    For instance think of a datasrc dimension which looks like this, one parent and two children:
    AllDatasrc
    -- InputData
    -- AllocResult
    The allocation logic only considers data in InputData, and posts the results to AllocResult. The other reports (which should not reflect the allocation) are focused on InputData, while the allocation report looks at AllDatasrc, or possibly even all 3 members to show the "before and after"
    Once you make that change, you need to decide how it impacts everything else in the application. The currency conversion logic, perhaps should now include both InputData and AllocResult. That's up to you to decide.

  • Help in script logic

    Hi Experts,
    We are using SAP BPC 7.5 NW Version SP08. We are using a script logic that calculates the opening value of inventory(ASSTCAINVAMO) for each month except the 1st month of financial year for which the value is entered from an input schedule. The opening value of inventory of each subsequent months are calculated when the parameters for production(e.g. OSDA) are entered from a separate input schedule. The following script logic is written for the calculation:
    *FOR %TIM_MEM%=%TIME_SET%
    *XDIM_MEMBERSET TIME =%TIM_MEM%
    *WHEN P_ACCT2
    *IS "OSDA",
    REC(EXPRESSION=[P_ACCT2].[ASSTCAINVAMO]+[P_ACCT2].[RDPA][P_ACCT2].[EFFA][P_ACCT2].[OSDA]-[P_ACCT2].[CONVAMUR][P_ACCT2].[RDPU][P_ACCT2].[EFFU][P_ACCT2].[OSDU]-([P_ACCT2].[SALQAMBC]+[P_ACCT2].[SALQAMM]),P_ACCT2="ASSTCAINVAMO",TIME=TIME.NEXT)
    *ENDWHEN
    *COMMIT
    *NEXT
    The loop works fine, but it seems the list of time values are not coming in proper sequence. For example, the loop is running for 2011.NOV before it iterates for 2011.OCT. So when it iterates for 2011.NOV, it is not getting the opening value for the month and consequently 2011.DEC's opening value is calculated assuming 2011.NOV's opening value to be 0. In the input schedule the months are in proper sequence.
    Is there any way out so that the months come in proper sequence in the logic as well?
    Thanks in advance for any help.

    We had similar issue . we changed TIME members from Monthnames to numbers . i.e  changed 2011.JAN to 2011.01 . Then you get correct result  as you are expecting . Issue when using month names in combination of TMVL is that  , instead of getting 2011. MAY for TMVL(1,2011.APR) , it gets 2011.FEB . TMVL function some how takes alphabetical order instead of taking month order . Not sure if this behavior is with service pack . But never saw any thread reporting this issue .
    Anyways ,you can wait for other responses  as i am too curious to know if any one faced this issue and how did they resolve.

  • Script Logic in BPC is not working properly

    Hi All,
    I have the BPC Microsoft version 7.0.114. I am trying to create a script logic to calculate price x units.
    I have an application called GYP with the following dimensions:
    PL (Account type) in this dimension are the units
    Time
    Category
    Entity
    Product
    RptCurrency
    I have another application called PRICE with the following dimensions:
    Price  (Account type) in this dimension are the prices
    Time
    Category
    Entity
    Product
    RptCurrency
    The script logic i created in the GYP application is as follows:
    *XDIM_MEMBERSET PL="Units"
    *XDIM_MEMBERSET PRODUCT=<ALL>
    *XDIM_MEMBERSET ENTITY=<ALL>
    *XDIM_MEMBERSET CATEGORY="Budget"
    *LOOKUP PRICE
    *DIM PR:PRICE ="PRICES"
    *ENDLOOKUP
    *WHEN PL
    *IS "Units"
    *REC(FACTOR=LOOKUP(PR), PL="Revenues")
    *ENDWHEN
    *COMMIT
    I also put in the default.lgf :
    *INCLUDE UnitsxPrice.LGF
    *COMMIT
    I have loaded data for units and price only for one product to validate the script logic but I'm not getting any calculated value in the revenues element.
    I have read a lot of documentation about script logic but i haven't found which could be the problem.
    Please, could you help me to know what i am missing to?
    Thanks in advance for all your help.
    Regards,
    Luisana

    Hi,
    Your script logic looks fine to me. However, I would request you to make a small change in your default logic.
    Lets say that you created the script logic with the name CALCULATION.LGF, then the default logic should look like below:
    *INCLUDE CALCULATION.LGF
    Notice that the name of the script logic should be consistent (and I have removed the commit statement from the default logic).
    Hope this helps.

  • Script Logic - Scoping Statement Challenge

    Dear Friends,
    I have a requirement where I need to write a script logic to calculate the net of all Balance Sheet accounts which are under a Hierarchy node (say: BALANCESHEET) and post the reversal to another Account (say: 9999999) which is also located under the hierarchy node: BALANCESHEET
    Now the tricky bit is to exlcude the posting account (9999999) when I am reading the Accounts under the hierarchy node: BALANCESHEET.
    Anyone knows how to do it ?
    Below is my code which only works when the Account: 9999999 is located outside of the hier node: BALANCESHEET
         *XDIM_MEMBERSET ACCOUNT = BAS(BALANCESHEET)
         *XDIM_MEMBERSET TIME = 2014.APR
         *WHEN TIME
         *IS 2014.APR
         *REC(FACTOR = -1, ACCOUNT=9999999)
         *ENDWHEN
    The scoping statement I wish that would work is:
         *XDIM_MEMBERSET ACCOUNT = BAS(BALANCESHEET), BUT EXCLUDE 9999999
    Appreciate any response on this.
    Thanks,

    Hi Vadim,
    I was hoping you would respond.
    Your code worked like a charm!!
    I never know until now that we could use the below statement prior to *SELECT statement and use that variable within succeeding *SELECT statement.
    *XDIM_MEMBERSET ACCOUNT AS %ACCT% = BAS(BALANCESHEET)
    Because before I tried below with no luck but never knew about above statement.
    *SELECT(%ALLBSEXIMBAL%,"[ID]",GL_ACCOUNT,"[ID]=BAS(CBS) AND [ID]<>2199999")
    Even the SAP Help doesn't have the above syntax in their documentation, how did you know about it??
    You are a genius.
    Thanks very much for helping out
    Cheers!

  • Calculating sum in script logic

    Dear all.
    I am having a script which should be moving values from one parent account to another base account in default logic, but only if posted on certain other dimension, that is when not posted on a certain Brand in my brand dimension.
    Sounds pretty much simple..
    *WHEN CATEGORY
    *IS ACTUAL
    *WHEN BRAND
    *IS <> B_2600
      *WHEN ACCOUNT
      *IS  BAS(GROSS_PREORDER)
        *REC(EXPRESSION=([ACCOUNT].[GROSS_PREORDER]) ,ACCOUNT=GROSS_PREORDER_NOST)
      *ENDWHEN
    *ENDWHEN
    *ENDWHEN
    So if any values are posted on a base member of "GROSS PREORDER"-account, then put it onto GROSS_PREODRE_NOST, but only if CATEGORY = ACTUAL and BRAND different from B_2600.
    The above script works fine, as long as I only post one record at a time, but that's not realistic. The users necessarily need to be able to input data on all base members of GROSS_PREORDER and then send data.
    When you post eg. on three separate accounts below GROSS_PREORDER the result is posted three times onto GROSS_PREORDER_NOST.
    I cannot seem to find a good solution for this, but I don't think I'm the first facing this issue..?
    Best regards
    Mogens
    PS. I am using BPC NW 7.5 SP05

    Hi Nilanjan.
    That works.
    I don't really see why it should work compared to my first script, but isn't that just the irony of script logic..?
    In order to not put every and all data into my sum account I modified
    *WHEN ACCOUNT
      *IS *
    to
    *WHEN ACCOUNT
      *IS BAS(GROSS_PREORDER)
    Thank you very much for your help..
    Br.
    Mogens

  • Script Logic error when trying to Calculate P*Q

    I am new to MDX and Script Logic and need some help. 
    I am trying to calculate Price * Qty.  Prices are stored in an Account called Unit_Price, and Qtys are stored in Accounts as well.  We have a Service property called "DRIVER" that points to the Account that holds the Q for that Service, but I can't seem to refer to it in Script Logic.  So, for each Service, I want to find the corresponding Unit_Price, lookup the Driver for that service and then use that to find the corresponding Quantity.  However, I'm having trouble with the portion that points to the Quantity. 
    Can someone please help? 
    This is the error that I get when I try to run it in the Logic Debugger: 
    "Warning no. -2147467259 reading cell 0; The hierarchy '[SERVICE.DRIVER]' was not found in the cube when the string, [ACCOUNT].[SERVICE.DRIVER],was parsed. "
    Here is my Script Logic:
    *MEMBERSET(%BILL_ENTITY%,FILTER(DESCENDANTS([ENTITY].[547],99,LEAVES), [ENTITY].CurrentMember.Properties("BILLED_ENTITY")="X") )
    *XDIM_MEMBERSET ENTITY = %BILL_ENTITY%
    *MEMBERSET(%PQ_SERVICE%,FILTER(DESCENDANTS([SERVICE].[TOTAL_SERVICE],99,LEAVES), [SERVICE].CurrentMember.Properties("ALLOC_METHOD")<>"") )
    *XDIM_MEMBERSET SERVICE=%PQ_SERVICE%
    *XDIM_MEMBERSET CATEGORY = %CATEGORY_SET%
    *XDIM_MEMBERSET TIME = %TIME_SET%
    *XDIM_MEMBERSET DATASRC = INPUT
    *FOR SERVICE.ALLOC_METHOD = "PQ" 
                [ACCOUNT].[#16404ZZZ] = ( [ACCOUNT].[UNIT_PRICE], [TIME].currentmember) * ([ACCOUNT].[SERVICE.DRIVER], TIME].currentmember)
    *NEXT           
    *COMMIT

    1. completely uninstall all the nokia PC Suite products with this http://nds1.nokia.com/files/support/global/phones/software/Nokia_PC_Suite_Cleaner_7_1_1.exe, and also uninstall all OVI Suite products
    2. reboot pc
    3. download & Install a fresh copy of PC Suite
    4. it will then have you download and install a new version of the software installer after you connect your e90
    it should be fine after that. i had to do the same thing a while back.
    re: no able to sync the calendar with ovi suite:
    go to the Sync drop down and then select Sync Calendar.
    hope that helps

  • Script Logic based on %value% of the Account

    Hi All
    Hope everyone is doing great. This blog has been really helpful.
    Version: BPC NW - 10, sp12
    I have a situation where I am using an account as FLAG01 and based upon the flag value input by the user, I would like the calculation to be executed.
    I have written the basic algorithm which I am looking forward to resolve:
    When FLAG01 = 0
         Do Nothing
    When FLAG01 = 1
           [ACCOUNT].[B] = [ACCOUNT].[A] * (-1)          and goes into ENTITY = "US_ELIM"
    When FLAG01 = 2
           [ACCOUNT].[B] = [ACCOUNT].[A] * (-1)          and goes into ENTITY = "NA_ELIM"
    I have written the script logic, but guess missing the syntax somewhere.
    eg:
    *WHEN "FLAG01"
    *REC(EXPRESSION = %VALUE% = 1 ? ((-1)*([ACCOUNT].[A]), 0 , ACCOUNT = "B", P_ENTITY = "US_ELIM")
    *REC(EXPRESSION = %VALUE% = 2 ? ((-1)*([ACCOUNT].[A]), 0 , ACCOUNT = "B", P_ENTITY = "NA_ELIM")
    *ENDWHEN
    Any insights are appreciated.
    Thanks
    AJ

    Worked like a charm, just had to make minor tweaks based upon details to test it and it worked.
    *WHEN ACCOUNT
    *IS EL05
    *REC(EXPRESSION = ([ACCOUNT].[EL05])==1? (-1)*([ACCOUNT].[FN-COS.1.4.1]):0, ACCOUNT = "FN-REV.1.1.3.5", P_ENTITY = "A")
    *REC(EXPRESSION = ([ACCOUNT].[EL05])==2? (-1)*([ACCOUNT].[FN-COS.1.4.1]):0, ACCOUNT = "FN-REV.1.1.3.5", P_ENTITY = "B")
    *ENDWHEN
    Really glad how the results came out in 3-4 hit and trials.
    Thanks Vadim, appreciate your help on this.
    Thanks to all who helped.
    Regards
    AJ

  • Calculate SUM based in condition in iTAB

    Hi all,
    I have the ITAB as follows.
    wa_mseg-mblnr = '5000000130'.
    wa_mseg-mjahr = '2008'.
    wa_mseg-bwart = '901'.
    wa_mseg-dmbtr = '00000005000'.
    wa_mseg-bpmng = '00000000100'.
    wa_mseg-ebeln = '1059200855'.
    wa_mseg-ebelp = '00010'.
    APPEND wa_mseg to itab_mseg.
    wa_mseg-mblnr = '5000000131'.
    wa_mseg-mjahr = '2008'.
    wa_mseg-bwart = '902'.
    wa_mseg-dmbtr = '00000002500'.
    wa_mseg-bpmng = '00000000050'.
    wa_mseg-ebeln = '1059200855'.
    wa_mseg-ebelp = '00010'.
    APPEND wa_mseg to itab_mseg.
    wa_mseg-mblnr = '5000000132'.
    wa_mseg-mjahr = '2008'.
    wa_mseg-bwart = '901'.
    wa_mseg-dmbtr = '00000002500'.
    wa_mseg-bpmng = '00000000050'.
    wa_mseg-ebeln = '1059200855'.
    wa_mseg-ebelp = '00010'.
    APPEND wa_mseg to itab_mseg.
    now i want to add the BPMNG for the BWART = 901
                                   DMBTR   for the BWART = 901
    ans same thing  for the BWART = 902.
    how do i calculate the SUM based on condition.

    now i want to add the BPMNG for the BWART = 901
    DMBTR for the BWART = 901
    ans same thing for the BWART = 902.
    how do i calculate the SUM based on condition.
    Hi, you can loop de internal table and do a control cut by "bwart". For doing that the order of the fields of your internal table must change.
    If you have:
    1st.mblnr
    2nd.mjahr
    3rd.bwart
    you have to change to:
    1st.bwart
    2nd.mblnr
    3rd.mjahr
    So in the loop you will can do like this.
    loop at itab.
    aux_sum = itab-BPMNG + aux_sum.
    at end of bwart.
    * Here you will have de SUM for BWART.
    * Then you clear aux_sum for the next different BWART.
    endat.
    endloop.
    hope this help you.
    Andrew83

  • Can we calculate difference of  dimension properties values in script logic

    HI
    I have 3 products, whose manufacturing process starting perod and end periods are different for three products. Now I want
    to distribute total  manufactuing cost to those periods only for each product.  how will write script logic  for this senario.
    My system is BPC nw7.5
    Mahi

    Hi,
    So, you want to find the difference between the dates and distribute the cost among them. I dont think this will be feasible using script logic. My suggestion would be use BADI. Script logic cannot do manipulation on the properties. BADI will be much easier. In addition to this, you need to think what should be the destination of the result. Every record is going to generate few records (depending on the number of months).
    Hope this helps.

  • Next, Prior Time in Script Logic

    Hi there,
    I have a problem about script logic. I have 2 monthly rate types. One of them is end-of-period rate(EPR) and other is average rate(AR). i want calculate average rate(AR) summing two consecutive end-of-period rate, dividing 2. But i donu2019t know how can i get previous end-of-period rate. I used prior and next(-1) but it does not work. Can you explain it how can i do this?
    Example;
    --Jan-Feb---Mar
    EPR -2-3----4      
    AR----22,5--3,5
    *WHEN KUR_ACCOUNT
    *IS EPR
    *WHEN TIME.MONTHNUM
    *IS 1
    *REC(KUR_ACCOUNT=AR)
    *ELSE
    *REC(EXPRESSION=(%VALUE% + GET(TIME=NEXT(-1)) / 2, KUR_ACCOUNT=AR)
    *ENDWHEN
    *ENDWHEN
    *COMMIT
    Thanks in advance.

    What version and support package of BPC do you work on?  In BPC 7.5 a new time offset is possible with the keyword TMVL.
    Thanks and best regards,
    [Jeffrey Holdeman|http://wiki.sdn.sap.com/wiki/display/profile/Jeffrey+Holdeman]
    SAP Labs, LLC
    BusinessObjects Division
    Americas Applications Regional Implementation Group (RIG)

  • How to calculate Average

    Hi,
    I have a calc that is supposed to calculate the average but I dont know how to do it.
    Time prompt: enabled to take X number of months.
    $$: a certain amount of $$  corresponds to each month taken by the prompt
    Example:  8 months (Jan to Aug), $100 each =  800 / 8 = 100
    3 months (Jan to March), $100 each =  300 / 3 = 100
    The final amount (average) has to be posted to all the months of the next year.
    The issue is how to tell BPC the number by which the sum is going to be divided because it varies depending on the months taken.
    Thanx, i'll post my script here.
    I also have a prompt for the category (version) which may be Real, Budget, etc...
    *SELECT(%vapi%,"id","conceptos","vap='i'")
    *WHEN conceptos
    *IS %vapi%
    *WHEN metrica
    *IS hojas_r,metros_r,precio_r
    *WHEN tiempo
    *IS %tiempo_set%
    *WHEN versiones
    *IS Real_2011
    *FOR %anio%=2012
    *FOR %mes%=ene,feb,mar,abr,may,jun,jul,ago,sep,oct,nov,dic
    *REC(expression= %value%, tiempo=%anio%.%mes%,versiones="esperado_2012")
    *NEXT
    *NEXT
    *IS Real_2012
    *FOR %anio%=2013
    *FOR %mes%=ene,feb,mar,abr,may,jun,jul,ago,sep,oct,nov,dic
    *REC(expression= %value%, tiempo=%anio%.%mes%,versiones="esperado_2013")
    *NEXT
    *NEXT
    *ENDWHEN
    *ENDWHEN
    *ENDWHEN
    *ENDWHEN
    *COMMIT
    Thanx
    Velázquez

    Hi Karthik,
    Thanx for the reply, I changed the following:
    PROMPT(RADIOBUTTON,%MESES%,"seleccionar meses a promediar",1,{"1 mes"," 2 meses"," 3 meses"," 5 meses"},{"1","2","3","5"})
    TASK(Execute formulas,LOGICFILE,%APPPATH%..AdminApp%APP%TestAlldoraVentas2.lgf)
    TASK(Execute formulas,FORMULASCRIPT,"*FUNCTION VIGENCIA=%MESES%")
    (this one above is important)
    I know that Run_Stored_Procedure is not supposed to coexist with WHEN/ENDWHEN structures... however, I still posted it in my script logic, therefore I got this error:
    TOTAL STEPS  1
    1. Execute formulas:      Failed  in 1 sec.
    2. FX Restatement:        completed  in 1 sec.
    CHECKLCK= No
    MESES=5
    (Member Selection)
    TIEMPO: 2011.ENE,2011.FEB,2011.MAR
    Execute formulasError
    error running stored procedure PROMEDIO 5: Could not find stored procedure 'PROMEDIO'.
    Please help me out...
    I also tried adding %tiempo_set%  to the R_S_P but still doesnt work...
    Script:
    *SELECT(%vapi%,"id","conceptos","vap='i'")
    *SELECT(%vapc%,"id","conceptos","vap='c'")
    *SELECT(%vape%,"id","conceptos","vap='e'")
    *SELECT(%toner%,"id","consumibles","tipo='T'")
    *SELECT(%drum%,"id","consumibles","tipo='D'")
    *SELECT(%fusor%,"id","consumibles","tipo='F'")
    *SELECT(%otros%,"id","consumibles","tipo='O'")
    *XDIM_MEMBERSET conceptos=%vapi%,%vapc%,%vape%
    *XDIM_MEMBERSET consumibles=consumibles_dummy,%toner%,%fusor%,%drum%,%otros%
    *XDIM_MEMBERSET lob=servicios_out
    *XDIM_MEMBERSET metrica=precio_r,pieza_r,hojas_r,metros_r
    *XDIM_MEMBERSET moneda=usd,mxn
    *XDIM_MEMBERSET oi <> oi_dummy
    *XDIM_MEMBERSET vendedor = 01,02,03,04,05
    *RUN_STORED_PROCEDURE=promedio(VIGENCIA)
    *COMMIT
    *WHEN conceptos
    *IS %vapi%
    *WHEN metrica
    *IS hojas_r,metros_r,precio_r
    *WHEN tiempo
    *IS %tiempo_set%
    *WHEN versiones
    *IS Real_2011
    *FOR %anio%=2012
    *FOR %mes%=ene,feb,mar,abr,may,jun,jul,ago,sep,oct,nov,dic
    *REC(expression= %value% / %meses%, tiempo=%anio%.%mes%,versiones="esperado_2012")
    *NEXT
    *NEXT
    *IS Real_2012
    *FOR %anio%=2013
    *FOR %mes%=ene,feb,mar,abr,may,jun,jul,ago,sep,oct,nov,dic
    *REC(expression= %value%, tiempo=%anio%.%mes%,versiones="esperado_2013")
    *NEXT
    *NEXT
    *IS Real_2013
    *FOR %anio%=2014
    *FOR %mes%=ene,feb,mar,abr,may,jun,jul,ago,sep,oct,nov,dic
    *REC(expression= %value%, tiempo=%anio%.%mes%,versiones="esperado_2014")
    *NEXT
    *NEXT
    *ENDWHEN
    *ENDWHEN
    *ENDWHEN
    *ENDWHEN
    *COMMIT
    Thanx
    Velázquez

Maybe you are looking for

  • No way attaching files to a form without Reader Extension Server?

    Dear all, do I understand this right? There is no way to create a form to which attachments can be added using Acrobat Reader unless the form has been reader extended to do so with Reader Extension Server? If there are any possibilities I would be ve

  • Display Bug in CS4:  Gaping Rectangular Holes in the Image

    I first discovered this problem when I would open a psd file in Photoshop that I had worked on in Painter 11. There would frequently be, although not always, a large rectangular "bite": an area of the image that was empty, and through which you could

  • "Motion patch failed to render"

    Hi guys. I am hoping someone can help me with this very frustrating long term problem. No one on the Ken Stone forum wants to touch it. Basically it is this. Whenever I import Motion template files into the timeline I lose all ability to render. The

  • How to - Open a photoshop document - Interface or suit - for plugin

    Hello friends, Kindly help me... If we know the path to the document, is there any suit or interface available in photoshop cs2's sdk for opening a document in photoshop window? We are developing phtoshop automation plug-ins, to all user to encode an

  • J2ee logging approach

    hi, i am currently exploring on what approach to use for logging messages for my application. i am using the sun one appserver and stateless ejb's. may i know the best logging approach for ejb's? is there a logging software that would require less co