MDX  YTDAvg Calc

Hi Guys
I am still didnt solved the problem.
can any one help 
I have created 2 accounts
1 Month_Calc   I have written Evpro(Time.monthnum)
2 Month_Calc1   ( this account should pick monthnum)
[KEYFIGURES].[#YTDAVE] =([KEYFIGURES].[PERIODEND],[MEASURES].[YTD])/([KEYFIGURES].[PERIODEND],[ENTITY].[GAFRIC],[DATASRC].[INPUTSAP],[MEASURES].[PERIODIC],[ACCOUNT].[Month_Calc1]),solve_order=100
Business:   In Balancesheet YTD need to calculate Dynamically. For example if i select march its should pick 3 from Tim.monthnum. Already values r then in the TIm.Monthnum.
Narsi P
SAP BPC Consultant
OutlookSoft SA
0027 787082639

You may be better off building a Custom Measure that is not built in the dimensions, but rather in the sql TblMeasures location.  There is a How-to-Guide on SDN that discusses the use of Custom Measures and the Time Dimension.  This may be easier to manage and provide the flexibility to the customer, so that the Avg is calculated to accounts defined in the MEASURES rule.
Hope this helps.

Similar Messages

  • Corresponding MDX for calc script function

    <p>hi all,</p><p> </p><p>I have converted my BSO outline to ASO in 7.1.2.There in BSO oneof the members had formula which used functions like @XRANGE and@MOVSUM</p><p>now i need to write the MDX script for the corresponding memberBut i am not able find any function supporting this in MDX.</p><p> </p><p>Can somebody can help me out in this?</p><p> </p><p>thanks...</p>

    @MOVSUM() is probably best replaced by the following MDX for a trailing sum:<BR><BR>Sum (<BR> LastPeriods (<BR> (number of time periods here),<BR> [Time].CurrentMember<BR> ),<BR> (account you want to sum, or omit to do across all accounts)<BR>)<BR><BR>For a centered sum, you'd say something like:<BR><BR>Sum (<BR> LastPeriods (<BR> (number of time periods in range here),<BR> [Time].CurrentMember.Lead ( (number of steps ahead to start range) )<BR> ),<BR> (account you want to sum, or omit to do across all accounts)<BR>)<BR><BR>@XRANGE will have a corresponding TupleRange() function in Essbase 9. But in an ASO database,<BR>splitting the time dimension into separate year and period parts isn't generally worth it. Instead, having Month and Quarter levels of an attribute dimension gives users the ability to split them out, while making full use of the time series functions. <BR><BR>What specifically are you using @XRANGE to accomplish? Maybe you don't even need the newer TupleRange() function.<BR>

  • Hyperion and ODI Integration

    While integrating Hyperion Essbase and ODI (oracle Data integrator) , can ODI directly read from Hyperion or does Hyperion generates csv through which we can make ODI read .
    Can some one through some light on this process. since the Oracle documentation talks more abt the flat files like Csv etc. So i got this doubt.?
    Thanks

    Hi,
    You can perform the following task at the time of integration of ODI With Hyperion Essbase
    i) Data Loads
    ii) Dimension Loads
    iii) Data Extracts
    iv) Dimension Extracts
    Available Knowledge Modules for the Hyperion Integration with ODI are:
    RKM Hyperion Essbase
    LKM Hyperion Essbase Data to SQL
    LKM Hyperion Essbase Metadata to SQL
    IKM SQL to Hyperion Essbase (Data)
    IKM SQL to Hyperion Essbase (Metadata)
    3 types of Data Extract possible
    Report Scripts
    MDX Scripts
    Calc Scripts
    2 types of Load possible
    Rule file based load
    API based load
    There is no limitation of using csv file you can load metadata or data from RDBMS (ISO 89 Syntax Supported E.g. DB2,Oracle,SQL Server),text file even from xml

  • Converting Calc to MDX

    Hi Experts,
    I am very new to MDX, hence need help in converting this calc into MDX Query-
    If(@ISIDESC("L-206125"))
         "70170023"
    EndIF;
    Where "L-206125" is from Departments dimension and "70170023" from Accounts. I have this formula on one more Department.
    I tried to convert in MDX and got this-
    IIF (Is(Departments.CurrentMember,[L-206125]) OR Count(Intersect({Descendants[L-206125]},{Departments.CurrentMember}))= 1)),Accounts.[70170023], #Missing)
    But I am getting syntax error whenever I validate this.
    Please anyone help me out of this issue?

    I took your requirement (sort of) and transferred it to my second favorite Essbase database in the whole wide world, aka, ASOSamp.Sample and, if you'll forgive my my child-like MDX:
    CASE WHEN CONTAINS([Geography].Currentmember, Descendants([North East])) THEN
         [Original Price] * -1
    ELSE
         42
    ENDWorks for me.
    So in your case:
    CASE WHEN CONTAINS([Departments].Currentmember, Descendants([L-206125])) THEN
         [70170023]
    ELSE
         Missing
    ENDDo you really want to write Missing to all other intersections, or just the first condition in the CASE? You decide.
    Regards,
    Cameron Lackpour

  • Statistical calc with MDX question (Mode function as an excel)

    Hi All,
      I need to create an MDX Calc to Returns the most frequently occurring, or repetitive, value in an array or range of data.
      For example, the mode of 2, 3, 3, 5, 7, 10 is 3.
      In Excel I use the MODE() function but I don't know how to do this in MDX and add it as a measure in Universe.
      I can't do the formula in WEBI because we have big data volume and I can't retrieve all the customers in WEBI.
      We have SAP BW 7.0 and SAP BusinessObjects XI 3.1 fix pack 1.3
    Thanks in advance.

    Hi,
    it looks like you created the entry twice so I would suggest you close on of them:
    Statistical calc with MDX question (Mode function as an excel)
    I don't think that those kind of statistical functions are available in MDX. you can always go to se37 and use the bapi_get_functions to see the list of supported functions.
    Ingo

  • Need help in converting BSO calc in to MDX in ASO

    Hi,
    Please find the calc that calcs Cash App Write Offs in calc script in BSO cube
    Fix(Feb,FY11,Actual,allocation,@levmbrs("All End Users",0),@levmbrs("All Sold To",0));
    "Cash App Write Offs"
    IF ("Invoice Price Gross Sales"->"All Products"->"BW_Input" ==#missing)
                        "Cash App Write Offs" = "Allocation_Input_Cash_Writeoff";
    ELSE
    "Cash App Write Offs"->"Allocation" = "Product_Pct_of_Invoiced_Sales"->"BW_Input" *"Allocation"->"Allocation_Input_Cash_Writeoff"->"No Product";
    ENDIF
    Endfix
    Please let me know whether the below logic is correct for ASO cube through MDX for the above calc in BSO
    Case When IS([Scenario].currentmember,[Actual]) and IS([Dimension].currentmember,[Allocation]) and IS
    ([Years].currentmember,[FY11]) and IS ([Time].currentmember,[Feb]) and IsLevel([All End Users].CurrentMember, 0)
    and IsLevel([All Sold To].CurrentMember, 0) and ([Invoice Price Gross Sales],[All Products],[BW_Input])=#Missing))
    Then
    [Cash App Write Offs]=[Allocation_Input_Cash_Writeoff]
    Else
    ([Cash App Write Offs],[Allocation])=([Product_Pct_of_Invoiced_Sales],[BW_Input])*([Allocation],
    [Allocation_Input_Cash_Writeoff],[No Product])
    End
    Thanks in advance....
    Edited by: 848657 on Mar 30, 2011 9:40 AM

    hi,
    chk this code.
    CALL FUNCTION 'SPELL_AMOUNT'
    EXPORTING
    amount = amount
    currency = 'EUR'
    filler = ' '
    language = 'E'  => give the language as italian
    IMPORTING
    in_words = amountrs.
    rgds
    anver
    pls mark all hlpful answers

  • Question converting calc to mdx

    &ForecastStart and &ForecastEnd are 2 of my substitution variables in Essbase.
    How to express "&ForecastStart:&ForecastEnd" in mdx formula please? Thanks!

    Hello,
    have a look at this.
    Using Substitution Variables in MDX Queries:
    http://docs.oracle.com/cd/E12825_01/epm.111/esb_dbag/dmaxldml.htm#dmaxldml50380
    Regards,
    Ahmet

  • Date in MDX Script

    Hi,
    I am trying to write in mdx editor the following query which will give me previous month date.
    SELECT
    +{(DateRoll(today(),DP_Month,-1),jan)} on COLUMNS+
    +from [sample.basic]+
    But it gives syntax error. I checked DateRoll function and Today() function in calc script and it was shifting my date to previous month.
    Please have a look.
    Thanks in advance
    Edited by: user10760185 on Jun 21, 2012 12:09 AM

    You're mixing Dates and Members. DateRoll function will only work with a 'Date-Time' dimension which is a special type of Time dimension you build with the EAS wizard and only for ASO databases.

  • Help in Mdx query

    Consider below is the dimesion
    Evry project will have one last project id which is projectid only
    Project id  Last ProjectID
    1                   4
    2                   6
    3                  null
    4                  null
    5                  null
    6                  null
    below if the fact
    projectid Amont
    1              100
    2               200
    3                300
    4                 500
    I need calculated measure to get amount of corresponding last project id for each project
    When I use column Project id -> for project id 1 my calc measure  shud give me 500
    I can not calculate it in DSV.
    I need to calculate it with MDX only
    I tried taking last project id member value and pass as string to project id member -- but its not working
    Can any one please help in writing MDX exp for the same

    Hi ,
      Please try the below calculated measure 
    sum(StrToMember(" [Dim Project].[Project ID].&[" + [Dim Project].[Last Project ID].Currentmember.member_caption + "]" ),[Measures].[Amount])
    Best Regards Sorna

  • MDX - how to calculate the sales between a certain period and the currentmember with a max date

    Hi all,
    1)I need to calculate the sales between W1 and the currentmember, but the max date should be W20. How can I solve this in MDX?
    MEMBER [Measures].[Q1 act.period to date sales] AS
    Sum(
    [Date invoice].[Bonus calendar - Week].[Bonus week of year].&[2015]&[1]
    [Date invoice].[Bonus calendar - Week].Currentmember
    *[CurrentSalesPeriod]
    ,[Measures].[Sales amount]
    This is the measure I have, I need to add the max date is W20. 
    2)Also, when I calculate the sales between [Date invoice].[Bonus calendar - Week].[Bonus week of year].&[2015]&[40] and the currentmember, for example being [Date invoice].[Bonus calendar - Week].[Bonus week of year].&[2015]&[20],
    he calculated the sales between this period. However, in theory this is not possible because W20 < 40. Is there any way I can put a constraint on this that he only calculates the sales if the currentmember is > the start period?
    Thanks in advance!

    Y, you can put a check on to determine if currentmember > start period.
    Firstly, your period keys are composite of year and period (indicated by the two ampersands in the fully qualified date above). If your period keys were non-composite (eg 201501) it would be a simple matter of 
    IIF([Date invoice].[Bonus calendar - Week].Currentmember.properties("key") > [Date
    invoice].[Bonus calendar - Week].[Bonus week of year].&[2015]&[1].properties("key"),[Measures].[Sales
    amount],null)
    There are advantages of having two period attributes on the dimension, one with a fully unique
    key and the other with just the period of fy, but that's digressing.
    With your composite keys, you could use a calc like the following for the SUM()
    Sum(
    [Date invoice].[Bonus calendar - Week].[Bonus week of year].&[2015]&[1]
    [Date invoice].[Bonus calendar - Week].Currentmember
    *[CurrentSalesPeriod]
    ,IIF([Date
    invoice].[Bonus calendar - Week].Currentmember.parent.properties("key") +[Date
    invoice].[Bonus calendar - Week].Currentmember.properties("key") > [Date
    invoice].[Bonus calendar - Week].[Bonus week of year].&[2015]&[1].parent.properties("key")+[Date
    invoice].[Bonus calendar - Week].[Bonus week of year].&[2015]&[1].properties("key"),[Measures].[Sales
    amount],null))
    Richard

  • MDX for hierarchy extraction

    Does anyone know of a way to use MDX to create a generational extract of hierarchies from Essbase? I know the outline extractor will do this, but our co will not allow us to use this as it is not supported by Oracle.
    Any suggestions??

    I think it depends on what you are looking for exactly. If you are looking for an extract that will look like what you get out of outline extractor or something you can re-use in a load rule, then the answer is no.
    MDX only allows one dimension per axis so there isn't a way to write a query that lets you put Gen 1 members in 1st column and Gen 2 members in second column. Each column represents an axis so that isn't going to work. Try to think about how you would do it in Excel addin, you can't and it is the same concept.
    You can easily write a query that will let you query member lists and filter based on Gen 1, Gen 2, etc. But how you match them up to know what the correct parent for any given member would be, is a challenge.
    A less than elegant solution would have been if you could query and return the fully qualified member name (i.e. [Year].[Qtr1].[Jan]) then at least you could have copied into Excel and with some basic parsing you could have pulled it apart to come up with the result. Unfortunately the Oracle Essbase version of MDX is extremely lacking. It's kind of sad when you compare it to pretty much everyone else who uses MDX. I blame this in large part on the initial idea that they would bastardize MDX to make it look more like Calc script language Essbase developers were used to rather than say "hey, this is what everyone else uses so we should use it too". Kind of like the United States and the metric system. But I digress, the point is that MDX for Essbase is limited and so there is no good way I am aware of to do what you are looking to do.
    That being said if you were just looking for informational purposes or documentation, you could try using the Ordinal() function to return members and report what generation they are.

  • Is there any Update command in MDX query

    My situation is follows:<BR><BR><BR> Jan-2005 Brands Products Sales <BR>Bill:20001-ABC 100<BR>Bill:20001-XYZ 20<BR> Customers<BR><BR>Is there any way where i can delete the member "Bill:20001-XYZ" and add the value 20 into<BR>"Bill:20001-ABC" so that it becomes<BR><BR><BR> Jan-2005 Brands Products Sales <BR>Bill:20001-ABC 120<BR> Customers<BR><BR><BR>Is there any update command introduced in MDX query which would resolve the above issue?.

    In it's current incarnation, Essbase MDX can't do this, I believe it is coming in a future release, but I wouldn't expect it too soon, maybe within a year. There are others that can provide more insight if and when it will be available.<BR><BR>By the way, I'm assuming this is an Aggregate Storage Database. If it were a Block Storage database, there would be a couple of different ways to do this (Calc script, lock & send via spreadsheet)<BR><BR>

  • Custom Calculation in ASO - Error in MDX query

    Hi All,
    We are trying to use a run a custom calculation on our ASO cube
    We are getting the error as below
    Syntax error in input MDX query on line 13 at token ' )'
    When i checked my POV i did not find any issue. Even when I try to put only one crossjoin, it is still giving me the error saying "error at line 2')' "
    I am unable to find the cause of this issue.
    Can any one help me on this.
    ******content of Maxl Script********
    execute calculation on database ASOFNPLN.ASOFNPLN with local script_file D:\++++++++Sateesh+++++++\ADWEA\Custom.csc"
    POV
    "Crossjoin({[FY09]},
    Crossjoin({[Actual]},
    Crossjoin ({[Jan],[Feb]},
    Crossjoin({[Working]},
    CrossJoin({[XA]},
    CrossJoin({[0000000]},
    CrossJoin({[000000000]},
    CrossJoin({[00000]},
    CrossJoin({[175110]},
    CrossJoin({[CC_ADWEA_0000_AED]},
    CrossJoin({[Unspecified Product]},
    CrossJoin({[HSP_InputValue]},
    CrossJoin({[Local]} )))))))))))))"
    SourceRegion "{[Opening Balance],[Ending Balance],[Periodic Balance]}";
    *************** Content of Custom.csc *********
    case when
    IsUda([Account].currentMember, "Expense") OR IsUda([Account].currentMember, "Revenue")
    AND
    Is([Period].CurrentMember, [Jan]) OR Is([Period].CurrentMember, [Feb]) OR Is([Period].CurrentMember, [Mar]) OR Is([Period].CurrentMember, [Apr]) OR Is([Period].CurrentMember, [May]) OR Is([Period].CurrentMember, [Jun]) OR Is([Period].CurrentMember, [Jul]) OR
    Is([Period].CurrentMember, [Aug]) OR Is([Period].CurrentMember, [Sep]) OR Is([Period].CurrentMember, [Oct]) OR Is([Period].CurrentMember, [Nov]) OR Is([Period].CurrentMember, [Dec]) OR Is([Period].CurrentMember, [YearTotal])
    THEN
    ([Ending Balance]):=([Opening Balance]+[Periodic Balance]);
    ([Opening Balance]):=([View].[Ending Balance], [Period].CurrentMember.lag(1));
    ([Ending Balance]):=([Opening Balance]+[Periodic Balance]);
    END

    You've got a mismatched " in the first line of the "execute calculation" statement.
    However, I think the real problem is in the calc script.  I don't believe you can do this in MDX:
    CASE WHEN x THEN
        a := y;
        b := z;
    END
    You have to do this:
    a := CASE WHEN x THEN y END;
    b := CASE WHEN x THEN z END;
    An alternative is to create a formula member for each of the measures you are trying to set (with the member formula containing the CASE logic) and have the calc script copy the formula member to the permanent member.

  • Need help regarding complex calculation using Max value and limiting data after Max date in MDX

    I am working on a bit complex calculated measure in SSAS cube script mode.
    Scenario /Data Set
    Date
    A
    B
    C
    A+B
    5/29/2014
    Null
    34
    Null
    34
    6/30/2014
    Null
    23
    45
    68
    7/15/2014
    25
    -25
    Null
    0
    8/20/2014
    -34
    Null
    Null
    -34
    9/30/2014
    25
    Null
    60
    25
    10/15/2014
    45
    -45
    Null
    0
    11/20/2014
    7
    8
    Null
    15
    a) Need to capture latest non-null value of Column C based on date
    with above example it should be 60 as of 9/30/2014
    b) Need to capture column A+B for all dates.
    c) Add values from column (A+B) only after latest date which is after 9/30/2014. 
    with above example it's last 2 rows and sum is 15
    d) Finally add value from step a and step c. which means the calc measure value should be = 75
    I need to perform all this logic in MDX. I was able to successfully get step a and b in separate calc measure, however i am not sure how to limit the scope based on certain date criteria. In this case it's, date> Max date(9/30/2014) . Also how should
    i add calculated members and regular members?
    I was able to get max value of C based on date and max date to limit the scope.
    CREATE MEMBER CURRENTCUBE.[Measures].[LatestC] AS
    TAIL( 
      NONEMPTY(
        [Date].[Date].CHILDREN*[Measures].[C]),1).ITEM(0) ,visible=1;
    CREATE MEMBER CURRENTCUBE.[Measures].[MaxDateofC] AS
    TAIL( 
      NONEMPTY(
        [Date].[Date].CHILDREN,[Measures].[C]),1).ITEM(0).MemberValue ,visible=1;
    Please help with Scope statement to limit the aggregation of A+B for dates > MaxDateofC? Also further how to add this aggregation value to LatestC calc measure?
    Thank You

    Hi Peddi,
    I gave TRUNC to both of the dates. But still the same issue. I think the problem is in returning the BolbDomain.
    return blobDomain;
    } catch (XDOException xdoe) {
    System.out.println("Exception in XDO :");
    throw new OAException("Exception in XDO : "+xdoe.getMessage());
    catch (SQLException sqle) {
    System.out.println("Exception in SQL :");
    throw new OAException("SQL Exception : "+sqle.getMessage());
    catch (OAException e) {
    System.out.println("Exception in OA :");
    throw new OAException("Unexpected Error :: " +e.getMessage());
    Thanks and Regards,
    Myvizhi

  • Beginning Inventory calc in ASO

    I'm just trying to put a simple calculation to link the beginning inventory balance to the prior period ending inventory.
    Here is what I put on the member formula:
    For Apri (April as the first month of the fiscal year)
    Beg Balance =
    (PrevMember(Year.CurrentMember,Level),[Mar],[Ending Inventory])
    For May-March:
    Beg Balance =
    (PrevMember(Period.CurrentMember,Level),[Ending Inventory])
    However, I keep getting the error below for retrieve (no problem for saving the outline)
    Error executing formula for "Beginning Inventory": Recursion limit [31] reached.
    I think it's because the formula confuses itself with the April and March balances kinda of referring to themselves....But it's for different years and it should just roll forward. I had no problem with BSO calc scrip or business rules.
    Any trick I can learn to make it work in MDX ? Really appreciate your help! Thanks.

    OK but you still will have to load every years begining inventory
    Besides you did not use that very begining inventory number in any of the formulas I saw. Nevertheless if the only beginnning inventory amount is more than 31 months back from any month you are in trouble.
    ANYTHING other than preloading BoY inventory will be slower -
    The only possible alternate solution is to write a formula for BoY inventory that says it = sum of the previous years ending inventory WITHOUT including BoY
    1 change your Ending Inventory formula to recurse ONLY to BoY - and not explicitly jump to prior years.
    Add a BoY formula with a lower solve order that sums(Purchases - sales) for all prior years + the special beginning of cube inventory value
    Assuming you built the following into your year dimension:
    YearsMultiple hierarchies enabled
    FYs label only
    fy12
    fy11
    fy10
    FY09
    Internal Calc Usage label only
    PreFY12
    FY11
    PreFY11
    FY10
    PreFY10
    FY09
    PreFY09
    Then the formula for your BoY member could be just ( StrToMbr( Concat( "Pre", [Years].CurrentMember_Name ) , Purchases ) - ( StrToMbr( Concat( "Pre", [Years].CurrentMember_Name ) , Sales ) + ([Special BofCube Beg Inv Account], [First Year], [Whatever month you loaded it to] )

Maybe you are looking for

  • How to make a bootable backup on external hard disk?

    Hi guys, I want to ask how can make a backup of entire C(windows) drive on my external hard disk.I tried using backup option in my transcend hard drive software but it gave me some errors..So I used backup option C:>properties and made a backup on my

  • Query Selection Screen in Report Designer/WAD

    Hi Gurus, Please help. Iam try to copy two BEx queries into one report using Report Designer & Web Application Designer. Iam sucessfull in it, however when I execute the report either by report designer or WAD, the report does not populate the select

  • Embedded images

    Sometimes when we place a copy of a slideshow on another computer we get a warning message that some images are missing. Is there any way to ensure all images are embedded?

  • Need PAPI WebService WSDL files - INPUT & OUTPUT schema will do

    Dear Friends, I need all the wsdl files or atleast input and output schema for all PAPI Web Services. Currently I dont have access to development env but need to put this in a document. The Oracle documents related to PAPI WS does not include this. T

  • Receiving messages from non AT&T customers

    I have been unable to receive text messages from non AT&T customers for a few days now. I am able to send texts no problem. Looking for a quick solution please.