Setting in BEx formula for calculation of YTD and MAT

Hi,
I have to implement 2 formulae in BEx.
As I am trying to avoide ABAP coding, can anyone please suggest SETTINGS in BEx FORMULA to achieve these below mentioned 2 formulae -
1 ) Calculate YTD - Average of the sum of the reported quarter values from the start of the year until and including the selected quarter. But, if we enter Quarter 3 and there is no data for quarter 2 then the average should be equal to sum of data for Q1 and Q2 divided by 2 instead of 3 even though user entered Q3.
2) Calculate MAT - Average of the sum of the reported quarter values for the last 4 quarters. We need to check last 4 quarters. If data is present only for 3 quarters in the last four quarters then the MAT will be data for 3 quarters divided by 3.
Please suggest BEx formulae settings, if any for the above calculations.
Thanks a lot.
Regards,
Prerna

Hi
I am not sure requirement related YTD is possible without customer exits variable
But regarding your 2nd requirement
Calculate MAT
Create four restricted key figures by using offset (0, -1, -2, -3) and restriction characteristic will be quarter.
Create a calculated key figure "Count of Quaerter". This will consist of "Number of rows" key figure with exception aggr on the Quarter characteristic and aggr will be "Count for all not eq to 0".
Create a calculated key figure which will be sum of four restricted key figures divided by Count of Quarter.
Kindly let me know incase further details required
Best Regards
Rohit

Similar Messages

  • Formula for calculating aggregate percentage and percenatge of gender

    hi all
    i have a sp from which i get result columns  gender,percentage,studentcount,year
    my sp is like this..
    IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[usp_GetState]') AND type in (N'P'))
    DROP PROCEDURE usp_GetState
    GO
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE PROCEDURE [dbo].[usp_GetState]
    ( @ExamYear Smallint
    ,@ExamType Nvarchar(10)
    AS
    BEGIN
    SET NOCOUNT ON;
    WITH cte_Schools AS
    SELECT
    [Foreign]= CASE WHEN M.Zone ='F' THEN 'Y' ELSE 'N' END
    ,CASE WHEN M.Zone ='F' THEN UPPER(C.CountryName) ELSE UPPER(S.StateName) END StateName
    ,COUNT( DISTINCT M.SchoolCode) Schools
    ,SUM( M.Nos) Students
    FROM rptFinalResultSummaryMaster M
    LEFT OUTER JOIN State S ON M.StateCode=S.StateCode AND M.Zone=UPPER(LEFT(S.Zone,1))
    LEFT OUTER JOIN Country C ON S.CountryId= C.CountryId
    WHERE M.Year=@ExamYear AND M.CourseCode=@ExamType
    GROUP BY CASE WHEN M.Zone ='F' THEN 'Y' ELSE 'N' END
    ,CASE WHEN M.Zone ='F' THEN UPPER(C.CountryName) ELSE UPPER(S.StateName) END
    SELECT
    SlNo=ROW_NUMBER() OVER(PARTITION BY [Foreign] ORDER BY StateName)
    ,[Foreign] ,StateName, Schools, Students
    , Percentage = (Students/(SELECT SUM(Students)*1.000 FROM cte_Schools))*100
    FROM cte_Schools
    ORDER BY [Foreign],StateName
    END
    GO
    now..i wrote formula for percentage  and when i connected this sp to my rdl where i took tablixi gave percentage value to gender and total percentage column
                                           gender(column group)                      
    total
    number   percentage
    passcategory         
    this is my tablix format
    my output looks like
    boys     girls                                     
    total
    number(percentage)
    passcategory1  (percenatge)                        21 (40.38)          43 (56.75)          
           64(48.56)          
    passcategory2   (percenatge)                       11  (21.15)         10    (13.51)               31(17.33)
    passcategory3    (percentage)                       20 (38.46)         21    (28.37)               41(33.41)
    total                     (percentage)                     
    52(xxx)           74  (xxx)                     136   (100%)
    i'm not getting thegender percentage properly for girls and boys total percentage of boys and girls coming correctly but individual percentage is not properly coming...that's because in sp i gave calculation for only total percenatge ..how can i calculate
    the individual percentage of girls and boys in single column...so that i can place in gender column in tablix..and i can retrieve individual percentgaes of girls and boys seperately as shown in output..
    please reply..its urgent
    thanks in advance..
    lucky

    please reply..its urgent
    Here is a tip: if you want to tick off people from helping you, you should absolutely include "urgent" in your post. That's a good way to encourage people to move to the next post. I did see this one earlier today, but did not have the time.
    Anyway, I cannot really make out heads or tails of your question. Your output takes about gender, but I cannot see it in the output from the query, which appears to group by "Foreign" and StateName. How does the boys and girls get into the picture?
    And for that matter that "totals" column?
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Pls tell me the exact formula for calculation of Safty Stock with quality example

    Pls tell me the exact formula for calculation of Safty Stock with quality example

    Hi Devendra,
    safety stock is a quantity of stock which should be planned to be in inventory to protect against fluctuations in demand or supply. Therefore it is considered in planning.
    The Product Planning Details screen is mainly a planning screen, giving an overview on the planning situation for a product in a planning area. The projected stock reflects the planning behavior, displaying the shortages relevant for the planning run.
    As the safety stock has to be always in stock, the projected stock takes it into account as an immediate demand. That is why it reduces the projected stock, for example, if the stock on-hand is 0, then the initial planning situation for the product with a safety stock shows a negative projected stock.
    For more information please check the help document “Material Planning Settings “ under section safety stock which explain with pictorial rep.
    hope it help you.
    Regards,
    Suresh

  • P & L report for current period,YTD and previous YTD

    I am trying to create a P & L report with the columns for current period,YTD and previous YTD,  I have include the measures as the key of columns, which by using period or YTD we can retrieve the current period and YTD column, is there as easy way to get the previous YTD? although I can get it  by using evtim to het every month and calculate the previous YTD.

    resolved, just need to bring both time and measures in the columns

  • Set up Company Codes for Contract Accounts Receivable and Payable

    HI,
    I need clarification on "Set up Company Codes for Contract Accounts Receivable and Payable"
    When a company code "ABCD" isn't set up for contract accounts receivable and payable (Menu path:
    SAP Insurance -> Collections/Disbursements -> Organizational Units -> Set up Company Codes for Contract Accounts Receivable and Payable), are postings on this company code "ABCD" within FS-CD not allowed and blocked ?
    Is it mandetory to specify company codes to post in Contract Accounts Receivable and Payable in SAP FS-CD.

    Yes .  It is mandatory to extend company code chart of accounts to CA/CR and FSCD.
    Srinivas

  • How could I set the proxy settings for just some URLs and not for all?

    Hello,
    I am using HttpURLConnection to establish a HTTP connection . The connection pass through a proxy, and it requires security.
    I know that I can set the proxy settings in the system properties, and this works perfect.
    But I don't want to set the proxy settings in the system properties, because this proxy settings will be for ALL the URLs, and I just want for a few URLs.
    How could I set the proxy settings for just some URLs and not for all?
    Thanks

    java.net.URL.openConnection(java.net.Proxy proxy)
    @since 1.5

  • BAPI/FM for setting the user status for the Project definition and WBS elem

    Hi,
    I have to set the User Status for the Project Definition and the WBS elements in that project.
    The User status to be set is the same for the project and wbs elements.
    Please let me know if there is any BAPI/FM to set the user status..
    Thanks in advance.
    Regards
    Shiva

    Hi Shkithija,
    There is a dump encoutered in the form "PS_FLAG_GET_GLOBAL_FLAGS" for 'chk_precommit_ok' in the "BAPI_PS_PRECOMMIT".
    But it is showing SY-SUBRC = 0 when used along with BAPI_TRANSACTION_COMMIT.
    May i know what are input parameters we need to pass it to "BAPI_PS_PRECOMMIT".
    Do you have any idea.
    Please let me know
    Regards
    vishnu

  • TS1702 I am setting my ipad up for the first time and the onscreen instructions do not appear

    I am setting up an ipad for the first time and the online instructiuons don';t show up in itunes

    No.

  • [svn:cairngorm3:] 17872: Popup: Exposed set accessor of open for view state usage and fixed bug when closing from model within popup .

    Revision: 17872
    Revision: 17872
    Author:   [email protected]
    Date:     2010-09-27 08:04:40 -0700 (Mon, 27 Sep 2010)
    Log Message:
    Popup: Exposed set accessor of open for view state usage and fixed bug when closing from model within popup. http://www.spicefactory.org/forum/viewtopic.php?p=3932. Added new sample to show model and view state interactions.
    Modified Paths:
        cairngorm3/trunk/libraries/Popup/src/com/adobe/cairngorm/popup/PopUpBase.as
        cairngorm3/trunk/libraries/Popup/src/com/adobe/cairngorm/popup/PopUpFactory.as
        cairngorm3/trunk/libraries/Popup/src/com/adobe/cairngorm/popup/PopUpWrapper.as
        cairngorm3/trunk/libraries/PopupTest/.actionScriptProperties
        cairngorm3/trunk/libraries/PopupTest/src/samples/MyPopup.mxml
        cairngorm3/trunk/libraries/PopupTest/src/samples/PopUpPM.as
    Added Paths:
        cairngorm3/trunk/libraries/PopupTest/src/PopUpModelExample.mxml
        cairngorm3/trunk/libraries/PopupTest/src/samples/MyPopupWithModel.mxml

    Lots to be excited about. BUT...Just updated to 8.1 on one of my computers to test it out...
    Sadly, the following issue is NOT fixed for me. Is it with new projects only?  I haven't started a new project on 8.1 I've only opened an old project but the issue that I'm referring to which involves also a delay/freeze of anywhere from a few seconds to a MINUTE while the render bar goes from yellow to red and then back to yellow is still there. Boo.
    On the list above...
    Switching between sequences can turn the render bar red.
    This issue is incredibly easy to replicate. I really do hope it gets fixed. Here are the steps:
    1) Create two sequences with multiple short clips (the more clips the better)
    2) Make sure GPU acceleration is enabled.
    3) Add warp stabilizer to the clips in both sequences. Again, the more clips the longer the delay/freeze will be as the render bar goes from YELLOW to RED and then eventually back to YELLOW again.
    4) Hit SAVE.
    5) Now, toggle between sequences. You'll hit a short delay with a few clips stabilized and a LONG delay with lots stabilized. In my case this delay is around a full minute. The render bar will go from YELLOW to RED and then back to yellow...eventually.
    6) Toggle back to the original sequence and the delay occurs again.
    7) Once you've toggled between sequences and have gone through this delay, that's it, there is no longer a delay...UNTIL...(and here's the big kicker)...until the project is SAVED again. After that the issue returns when you toggle between sequences. Both saving manually and AUTOSAVING cause this issue. No way around it except not editing with GPU acceleration.
    Not sure what the issue is...caching issue when saving maybe? Either way, it stinks and it's still there in 8.1. Big bummer.
    Again, lots to be excited about with this release but I really was hopefully this specific issue was resolved.
    Sigh.

  • Formula for calculating Quarter value in current calendar Year

    Hi All,
    I have a requirement where in i need to display values for Q1 of Current Calendar Year, Q1 of Previous Calendar Year,Variance in Value and % Variance in Value...Similarly for Q2,Q3,Q4.
    We have built the report directly from Bex Query from the SAP tab in Crystal Reports. The formula for Quarter1,Variances etc are defined in Bex Structures and i am unable to get 'em individually here rather i am getting them as a whole in a single object with the structure name. Now is there a way that i can define my own formula in Crystal Reports so that i can get the values for the constraints defined above???
    If yes please give me the syntax or an example formula so that i can work around.
    please Help,
    Thanks & regards,
    R.N

    What fields are you getting?
    or what is the data you are working with is it
    transID, date, value......
    or is it
    Q1, Year1, Value.......

  • BEX Query for Week, MTD, YTD  for Sales data

    Hi,
    I want to display the sales data for current  Calender day, Cal week, Cal Month to date, Cal Year to Date and also for previous year Cal month, Previous Year Calender Year to Date data.
    Structure is like this. for displaying Sales data. No variables are used on selection screen regarding below structure.
    Calender Day I CalWeek I CalMonth(current) I CalMonth(previous Year) I YTD(current) I YTD(previous Year)
    Please suggest me I used the variable 0P_HAPCY is enough or I have to do any other setups.
    Message was edited by:
            Kaveri

    Kaveri,
         I think 0P_HAPCY doesn't work for all the columns. Well when the user enters date it will also have the year and month right? So what is the relevance of year entered by teh user.
    For the data for calender day, you can get directly from the user entry.
    For calweek data you need to derive week from the calday enetered by the user using customer exit.
    Similarly for month to date, and year to date.
    Use offsets on customer exit variables for previous year calmonth and previous year yera to date data.
    Hope this helps you...

  • Formula For Calculating An Average

    I have the below formula in a group footer (Group Footer #1) that is suppose to calculate the average between the accumlated number of days (i.e. {@Days Taken}) divided by the number of records (i.e. Count (). The value for the number of days is correct and the value for the record count is correct. For some reason the value for the average is not correct.  The average is not re-calculating when there is a new group.  The average is repeated for each group.  Is there anything wrong with this formula ?
    Sum ({@Days Taken})/Count ()

    Lenell,
    You need to tell it to divide the sums per group.
    So;
    Sum ({@Days Taken},)/Count (,)
    Replace with the field that you are grouping on.

  • 17 numbers max of BeX formula for Analyzer ?

    Hi experts,
    We have an Analyzer Excel Workbook, in that, we use a query with two keyfigures and on formula that sums the 2 keyfigures, in visualization options, all 3 have units and 9 decimals:
    The 2 keyfigures are FLTP types, one is an integer and the other is decimal number. One result is like this:
    Kfigure1 _____________ Kfigure2
    1.201.145.200.010 _____ 0.987025432
    The result of the formula is: 1.201.145.200.010'987000000
    As you see it doesn't take care more than 17 numbers, is 17 numbers the limit for BeX in Analyzer Workbooks ?
    Do you know any notes about that issue ?
    Thanks in advance.

    Hello John,
    This could be a limitation of BEx Analyzer/Excel or the OLAP engine limitation.
    Please, check if this behavior occurs on RSRT2 and RSRT transactions.
    You have to input the query's technical name instead the workbook's ID.
    If the behavior only occurs on BEx Analyzer, try to download the latest version:
           > bi710sp12_1200-10004472.exe   (if you are using BEx Analyzer 7.0)
           > bw350gui710_8-10004473.exe    (if you are using BEx Analyzer 3.x)
    Best regards,
    Edward John

  • What is the formula for calculating average cost for an item in inventory

    Hi,
    Can someone please share the formula to calculate average cost for an item in inventory which uses Average Costing?
    Thank you,
    Naren.

    HI
    When a transaction updates the average cost of an item, the new average cost is calculated as follows: 

  • Bex Formula for calcualting Value from Quantity & Price

    Hello,
    In my query I need to calculate the value by multiplying Quantity available in my cube and net price in my material master attribute.
    How can I do this?
    I tried creating a formula variable for net price and multipied it with Qty but it still says the formula is incorrect.
    Any suggestions please??

    I created a formula variable using replacement path as processing type, selected the reference characteristics as 0Material.
    Under replacement rule selected replace variable with "infoobject", replace with "Attribute Value" and selected my attribute infoobject "0Net_Price"
    In my calculated key figure I try to use this formula variable and multiply it with Qty,but it still gives a warning element not defined properly.
    Can you let me know if I have missed out any step in the formula variable creation??
    How is the final unit of the Calculated key figure determined? Does it take the unit of net price ??

Maybe you are looking for