Calculation context in Answer

I've a table including 4 columns as Prod Category, A, B, Ratio.
Ratio = 100*A/B.
If I created a new column named as
Prod Cat (80-20 pareto) = case when rsum(Ratio < 80) then Prod Category else 'All Other Products' end.
I can get the first %80 Ratio Products with its name and the resting is as 'All Other Products'
The problem is If I use Prod Category in my table/pivot table the ratio is being calculated correctly but when I use Prod Cat (80-20 pareto) instead of Prod Category then the ratio is repeat for all rows as 100*sum(A)/sum(B).
The question is for a run-time calculation how can I define its calculation context. I mean how can I tell OBI to calculate the ratio for the following alternatives
1-) row by row ->A/B for each Product category
2-) A/sum(B) -> Ratio for each product category by for all products
Edited by: BIEXP on 30-Mar-2010 10:46

Hi ravi,
But some times it will work correctly even though i right click---> create column , i don't think that might be the issue...
Need one more info :
MaxSales=MAX( [SAELSREVENUE] FOREACH [ QUARTER] )
IN ([YEAR]).
what is the main use of IN ( [ YEAR ] ) ( output context ) . is it mandatory to get the output.
can u pls explain  a little bit about the output context that we give to get the output.
calculation context 

Similar Messages

  • Contextoperators in bo 4.0(calculation context using sum)

    All,
    I am using Webi 4.0 version.I have a scenario in my webi report wherei need to sum up revenue.i want to sum up the sales  revenue generated by each employee for a store irrespective of the month.
    What i mean is even if the months are different i want to sum the revenuebased  on the branch and employee in column G.
    My webi report looks pretty much like the below sample.I dont want to apply any breaks or sections,Can i achieve this using context operators or calculation context.
    i have tried personally applying context opearators on totalevenue column by applying sum but its not summing up as in column g.
    for ex: sum(revenue for each(branchcode))
    i want to achieve the totals as shown in column totalrevenue(last column) without applying break or section.
    Can any one helpme out.
    *Branch>>>>Employee>>Store>>>>Region>>>>>>>Month>>>>>>Revenue>>>>>>TotalRevenue
    *A>>>>>>>Dave>>>>>>>D>>>>>>>North>>>>>>>Jan-09>>>>>>>100$>>>>>>>>>     
    A>>>>>>>Dave>>>>>>>E>>>>>>>south>>>>>>>Jan-10>>>>>>>200$>>>>>>>>>>300$
    B>>>>>>>Andrew>>>>>F>>>>>>>east>>>>>>>Feb-09>>>>>>>10000$>>>>>>>>     
    B>>>>>>>Andrew>>>>>G>>>>>>>west>>>>>>>Feb-10>>>>>>>100000$>>>>>>>110000$
    Regards,
    Reji.
    Edited by: reji2011 on Dec 13, 2011 5:23 PM

    Hi Reji,
    Yes, there is a reset function for RunningSum() which is something like:
    RunningSum([My Measure];([My Dimension]))
    and I think the reset dimension has to be in parentheses. You don't have to use the reset part, but it is there if you need to.
    Thanks

  • Problem in a calculation in Oracle Answers

    Hello experts.
    I am facing some trouble in making a report.
    Dimensions and Facts are like this.
    Dimensions: Year Month, Quarter, Employee Name , Attribute Name (like A,B,C,D...I)
    Facts : Attribute Fact1, Attribute Fact2, Attriute Fact3
    Now we need to show DATA as follows
    Columns:
    Year | Month Quarter | Employee Name | (Attributes Name) A,B,C,D....J
    Measure: (A calulation on Fact1,Fact3 and Fact3)
    Eg. ((Fact1*Fact2)/Fact3)
    We used a Pivot Table to draw this analysis:
    In ROWS we put Year | Month | Quarter | Employee Name
    In Measures_Lables We put 'Attribute Name'
    In Measures we put an calulated column: ((Fact1*Fact2)/Fact3)
    Now problem is there is one condition that if value of ((Fact1*Fact2)/Fact3) for Attribue 'A' is Zero then we need to multiply rest of Attributes with some Factor, lets day 10
    I tried to put following Formulla/Expression:
    CASE WHEN
    IF NULL
    (CASE WHEN Attribute.Name IN ('A') THEN ((Fact1*Fact2)/Fact3) END)
    ,0
    ) = 0
    ) THEN
    ((Fact1*Fact2)/Fact3)*10
    ELSE
    ((Fact1*Fact2)/Fact3)
    END
    that is I am checking if Calculation for that Attribute ('A') is Zero then multiply by with 10 else just show calculation.
    What happend is as soon as I apply CASE on Attribute 'A' value of other Attributes go out of scope for that particular CELL, so for these cells (except A) 'IF NULL' block is evaluated true
    For example if data set is like this
    Year | Month | Quarter | Employee Name | A | B |
    2009 Jan Q1 Emp1 10 20
    2009 Jan Q1 Emp2 0 20
    THEN as per above my formulla resut it give is like this
    Year | Month | Quarter | Employee Name | A | B |
    2009 Jan Q1 Emp1 10 200
    2009 Jan Q1 Emp2 0 200
    So, for all other Attributes it muliplied by 10 because for all other cells it find value of A is 0 so it multiplies by 10
    I am starting to think it might not be possible to do it this way.
    Please suggest me a better way for this problem:

    You could write a view over the table that has the XML column and use Oracle XML DB functions to extract and represent the data in a table format. You can then map this view in Oracle BI Administration.
    I think stuff like XML transformations and extraction etc. is no task for Oracle BI and is best left to the Oracle Database.
    Thanks,
    Nilanshu.

  • How to refer a column in a calculated column in Answers Criteria

    Hi All,
    I have a set of columns (which contains column level filters).
    I also have 2 more calculated columns whose formula is based on the earlier columns (like (col1-col2)/col1 ).
    Presently, i'm using the col1 and col2 formulas and placed them in the calculated cols.
    Instead, is there any way to refer to the columns(col1, col2) without placing its col formula, in the calculated column.
    is there any such thing like.. ({c1} - {c2}) / {c1}
    Thank you,
    Raghu

    Hi,
    Thank you for the replies.
    actually i have a huge formula in 'col 1' and 'col 2' as well
    and in the new calculated col, i'm again using that huge formula to implement the logic col1-col2/col1.
    so, will this affect the performance.?
    or the performance will be the same?
    Thank you,
    Raghu

  • BW and Calculation Contexts

    Hi All,
    I have a Universe on top of a BW cube and in my report definition I get data for the object supplier, supplier group (which is a detail object to supplier), a few other dimensions and a measure revenue.
    A table in the report shows columns supplier group, supplier and revenue. If I add a column with the formula = sum([revenue]) ForAll ([supplier]) I get the total revenue for all suppliers in each row of the table instead of the revenue for each supplier group. It looks as if the formula ignores the additional dimensional context of the supplier group.
    Releases: BOE XI 3.0, BI 7
    Ideas?
    Thanks, Martina

    Hi
    In Business Objects, a Detail object has a particular characteristic: if its associated dimension is part of the axis context, it doesnt participate to this axis context as a key.
    ForAll clause makes total aggregation.
    Workaround consists in creating a variable (alias) with Dimension qualification as shown in the following example in which the [Age] is a detail associated to [Customer] and [Revenue] = sum([revenue]) ForAll ([customer]):
    Original Table
    Customer
    Age
    Revenue
    Arai
    18
    3286524
    Baker
    64
    3286524
    Brendt
    19
    3286524
    Diemers
    18
    3286524
    Durnstein
    36
    3286524
    Goldschmidt
    55
    3286524
    Kamata
    24
    3286524
    Kamimura
    38
    3286524
    Larson
    45
    3286524
    Makino
    45
    3286524
    McCarthy
    29
    3286524
    Mukumoto
    59
    3286524
    Okumura
    74
    3286524
    Table using  Age_Dim
    Now, create a variable Age_Dim on [Age] with the qualification Dimension
    Customer
    Age_Dim
    Revenue
    Arai
    18
    19012
    Baker
    64
    441594
    Brendt
    19
    8420
    Diemers
    18
    19012
    Durnstein
    36
    4400
    Goldschmidt
    55
    18715
    Kamata
    24
    748332
    Kamimura
    38
    4700
    Larson
    45
    782250
    Makino
    45
    782250
    McCarthy
    29
    400899
    Mukumoto
    59
    37050
    Okumura
    74
    22576
    I hope you this example would help you
    See you next

  • Resetting calculated values  in Answers pivot tables

    We have a a pivot table whereby we summarize by zones. Our calculation is derived using running aggregates.
    E.g
    Zone name | Value 1 | Value 2 | Calc Value
    Zone A X y x/y
    Zone B A B A/B
    However we are unable to reset the value of our running aggregate when our zone changes. Hence for Zone B in the example we are getting a value = (X+A)/(Y+B) when we want A/B.
    We are calculating our values at previous 7 day intervals so hence these have to be calculated at run time
    We are in 10.1.3.4
    All help would be appreciated.
    Thanks

    Hi,
    you can with this syntax inside the column Calc Value of a table view:
    RSUM(Value 1/Value 2 by Zone name)
    Hope it helps.
    Regards,
    Gianluca

  • Topn calculation in OBIE Answers

    I am trying to create an answer query that would provide me the top 5 categories by month in OBIEE Answers.
    For example if Dataset is :
    Widgets Photos Dogs Cats Cars Smurfs
    Month 1 100 50 20 10 1 8
    Month 2 60 40 80 5 2 1
    Month 3 80 1 40 22 9 9
    When in answers, I do something like add a column "rank_it" defined as sum (cnt_stuff by category) and then add a filter with operator (is in Top 5)
    I would expect Answers to give me sparse information like
    Widgets Photos Dogs Cats Cars Smurfs
    Month 1 100 50 20 10 8
    Month 2 60 40 80 5 2
    Month 3 80 40 22 9 9
    Instead the data is transformed
    Widgets Dogs Cats Cars Smurfs
    Month 1 100 20 10 1 8
    Month 2 60 80 5 2 1
    Month 3 80 40 22 9 9
    So, if I was looking for my Top 5 products or sales agents, I would miss out on my best performers which is photos in my scenario. Unless, I am misunderstanding how I identify my Top performers over time?
    From what I can tell, I need a separate table to store this information for this type of analysis. TOPN seems to work for 1 month or 1 year but not over a stretch of time.
    If I posted this in the wrong location or I am incorrect in my usage, please do inform me. Thanks in advance.

    hi
    in you bmm layer create a duplicate column for the #persons and double click it. Go to level and in the date dimension set the level greater than the least level.
    name your new column as #persons_total. select the aggregation as sum.
    add this column in the report. now your report looks like
    < 5 Days 14,090 22782
    5-10 Days 1,486 22782
    31 + Days 5,241 22782
    21-30 Days 792 22782
    11-20 Days 1,173 22782
    now you can calculate percent.
    Or you can directly get the percent value by the following..
    after creating a column as said above.. right click on the # persons column in bmm layer.. select calculated measure.. select the newly create measure for the comparison.. select percent... save the column as #percent.
    Use this column in the report. You will get directly what you requuired.
    Hope this helps. award points if it is.
    thanks,
    karthick

  • Odd Calculator Issue - Wrong Answer??

    A friend of mine was working on something yesterday afternoon and used his original iphone calculator to check 197/14.......the calc returned 1. I tried the same on my 3g and it returned a 1 for me too. In fact we both tried several times during the afternoon with the same result.
    Today I checked again and it returned the correct answer..........14.0714286.
    Seems odd to have intermittent "wrong" answers and definitely makes me wary of trusting calculator for anything. Any ideas?

    Computers are usually deterministic, so the most likely reason is that you both made an entry error yesterday.

  • Calculator gives wrong answer

    Imac 2,7 GHz Core i5. Mavericks updated. Calculator 10.8. I enter 10+10/2 and get 15. I enter 10+10= and get 20. I then divide result by two and get correct answer-10. But. Calculator broke the result (20) into 10+10 then divided by 2. (See entry 3 in Paper Tape). Simple 20 divided by 2 computes the correct answer-10. See Screen Capture. Any thoughts.

    Check the link below.
    http://www.mathgoodies.com/lessons/vol7/order_operations.html

  • Pre calculating queries in answers

    Hi all,
    It seems that pre-calculting query in database improves performance in answers reports like Materialized Views. Is for heavy report MV's creation is a right choices??? bec our schema size increases with materialized views but on the other hand it imporves the report performance amazingly. Any suggestion would be appriciated.
    Regards

    Hi, you can also try to cache the reports scheduling ibots.
    Regards.

  • Calculated measures

         Hi everyone
    Hoping that there is an easy workaround to the below
    I am calculating GM at a SKU level, however would like to be able to present the data at a product category and/or customer channel level
    However when I drag in my calculated field of GM per SKU it recalculates GM at a average product category level and uses that new calc to determine GM achieved, rather than summing the GM per product catergory.
    I basically want the GM to calculate at a SKU level but be able to present the data at an aggregate level,
    In excel the formulas would look like this:
    GM per SKU = ytd sales/ ytd sales quantity
    GM achieved for day per SKU = GM per SKU*qty delivered for the day
    GM achieved per category = sum(GM achieved for all SKUs in category)
    It looks like BO recalculates GM per SKU depending on what product field I drag in ie if my table to calculate GM had product catergory rather than SKU I am getting GM per category, which then impacts my final calculation
    I basically want the calcs to keep running at a SKU level but be able to present totals at an aggregate level, rather than aggregating data then calculating GM
    Hope this makes sense. Can attched screenshots if required.

    Hi,
    What you describe sounds very similar to the user guide's definition of the calculation contexts. Read the chapter "Understanding calculation contexts" and make sure that you get to know the input and output calculation contexts:
    http://help.sap.com/businessobject/product_guides/sbo41/en/sbo41sp3_ffc_user_guide_en.pdf#page=16

  • Context Operators

    Hi,
    What are context operators and where should we use?  
    Thanks in Advance

    Hi,
    Check attached links.
    http://www.dagira.com/2010/01/04/calculation-context-part-i-overview/
    http://bobi.blog.com/2014/03/10/in-foreach-forall-context-operator-in-bo/
    Amit

  • Calculating Average then using it in another calculation.

    Hi,
    I would be grateful if someone could point me in the right direction - as I'm clearly being daft!
    I have a report that summaries the  SalesValue measure (which is an aggregate function in the universe)
    Week 1          £1000
    Week 2          £1500
    Week 3          £900
    I have created a variable TOTAL SALES (sum(salesvalue)) which successfully displays £3400.
    I have created a variable for average (Total Sales /3) which displays £1133.33.
    What is the best way to  create a variable for each week to show the difference between the average (£1133) and the sales for the week i.e Week 1 = +133, week 2=+367, week 3 =-233.
    Whenever I create this variable (SalesValue-Average) and put it next to week it doesn't calculate based in the total sales (£3400)
    I'm sorry if this is one of those easy simple things but I am new to WEBI and I'm struggling.
    Many thanks in advance.
    Jude

    Hi Jude,
    Prashant gave a good suggestion, you need to use calculation contexts.
    PS: If you are new you would benefit from the official guides, especially Using Functions Formulas and Calculations that can be found at https://help.sap.com/boall_en
    There are also tutorials Official Product Tutorials – SAP BusinessObjects Web Intelligence
    Thanks
    Simone

  • 2004s file download (how to not store files in context?)

    Hi,
    I want to use FileDownload element in my web dynpro application.
    I use the new type resource  and my own input source implementation, which generates files on the fly.
    Each download call should result in a new file. These files can be very large (some MB).
    For obvious reasons I don't want the server to store the byte data in application context (200 users * 2 MB ....)
    How can I do this?
    If I use resource as context element and set debug points on my input stream, I can see the data is read just on time if the user wants to download.
    I create my data in my inputstream and the download starts. So far so good.
    On the second click on the download link the download starts without any read operation. Thats the problem.
    Possible reasons:
    First: the data is read and stored to the context on the first download. this would be bad! context would get very very large. not working for me.
    second: the browser or the server caches the data. how can I avoid this?
    thx in advance
    btw I read a tutorial about up and downloading. this pointed to an additional article called something like "downloading in web dynpro tables". But I can't find it. There the on demand downloading should be explained. any help would be great.

    Hallo Thomas,
    ok, the "default" on-demand streaming solution caches a Web Resource but does not re-calculate it again afterwards.
    I wrote a Wiki Code Tutorial which demonstrates how to download an Excel File from a Web Dynpro table UI element on-demand. In this scenario the resource must also be re-created on every request. The solution is based on re-initializing the context with a new  0-byte resource objects within the calculated context attribute getter method.
    See <a href="https://wiki.sdn.sap.com/wiki/display/Snippets/ExportingTableDatainWebDynproJava-SAPNetWeaver04s">Exporting Table Data in Web Dynpro Java - SAP NetWeaver 04s</a>
    For you the most important line of code in
    //@@begin javadoc:getExcelResourceOnDemStreamCalc(IPrivateExcelExportComp.IExcelElement)
       *  Declared getter method for attribute ResourceOnDemStreamCalc of node ExcelResource
       *  @param element the element requested for the value
       *  @return the calculated value for attribute ResourceOnDemStreamCalc
      //@@end
      public com.sap.tc.webdynpro.progmodel.api.IWDInputStream getExcelResourceOnDemStreamCalc(IPrivateExcelExportComp.IExcelElement element)
        //@@begin getExcelResourceOnDemStreamCalc(IPrivateExcelExportComp.IExcelElement)
        IWDInputStream excelOnDemandStream = null;
        try {
          excelOnDemandStream =
            WDResourceFactory.createInputStream(toExcel(tableDataNode, tableColumnInfos).getBytes("UTF-8"));
        } catch (UnsupportedEncodingException e) {
          wdComponentAPI.getMessageManager().reportException(e.getLocalizedMessage(), true);
        // Reset context attribute 'Excel.Resource' again by creating a new 0-byte resource object.
        // Otherwise the on-demand Excel stream gets calculated only once as the resource object,
        // cached in the Web Dynpro Binary Cache on server-side, keeps the same.
        initializeOnDemandExcelResource();
        // Return excel on-demand input stream
        return excelOnDemandStream;
        //@@end
    is the method <b>call initializedOnDemandExcelResource()</b> re-initializing the context attribute with a new 0-byte resource object.
    //@@begin others
      //======= Private Methods ===========================
       * Create new on-demand resource instance for excel file. This method must be
       * invoked initially and in the calculated context attribute getter method (calculating)
       * the excel resource input stream. Otherwise the resource is streamed to the client only
       * once but not afterwards so that later updates of the table data are not reflected in the
       * streamed Excel file.
       * URL is stored in context so context in client component can map to it.
      private void initializeOnDemandExcelResource() {
        excel0ByteResource =
          WDResourceFactory.createResource(calcAttrPointer, "Table.xls", WDWebResourceType.XLS);
        excelResourceElement.setResource(excel0ByteResource);
        excelResourceElement.setResourceURL(
          excel0ByteResource.getUrl(WDFileDownloadBehaviour.OPEN_INPLACE.ordinal()));
    Regards, Bertram

  • How recalc buffered value in calculated attribute?

    Hi everyone
    I have created some calculated context attribute and set the Buffer Mode to Buffered. As I understand this means that the value of attribute will calculated once, will buffered in memory and next will recalc "on demand".
    My question is - how can I invalidate the attribute value and call recalc function ?
    P.S. NW CE 7.2

    Hi,
    You can find out more details of [Calculated Context Attribute|http://help.sap.com/saphelp_tm80/helpdata/de/7f/a0384162316532e10000000a1550b0/content.htm] and [Calculated Attributes in Web DynproJava|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/e093a9d8-c00e-2b10-7dae-b72c3a8c5536]
    Hope this helps!!
    Regards
    Vijay K

Maybe you are looking for

  • What type of memory would be the best for my MacBook Pro 13" Mid 2010?

    I have a Mid 2010 13" Macbook Pro and I'm going to upgrade my RAM. I know I can upgrade up to 8GB of RAM, but I was wondering what is the best "brand" and what website I should buy it from. For example, eBay, NewEgg, Amazon / PNY, Crucial, etc?  Can

  • Names of tablespace in a schema

    How to identify the tablespaces that belongs to a schema ? Rephrasing the question: Query to list the tablespaces that are used in a particular schema of a database

  • Error: Validity of Certificate from list with PSE type PSE ends in 3 da

    Hello, our system is reporting the followin warning Error: Validity of Certificate from list with PSE type > PSE < ends in 1 days, more notes on system log (SM21) We check the transaction STRUST and STRUSTSSO2, the certificate between ERP and EP expi

  • Saving photos edited in PS Elements back  into iPhoto

    I'm new to PS Elements and love it but am having trouble saving photos. I have set my preferences in iPhoto to open in PS elements for editing. So far that's great. My question is when I'm finished editing in PS Elements how do I save the edited phot

  • Problems opening PDF's from Public Folders

    We have several Public Folders on an Exchange 2003 server that store some reference documents for users. Before updating to Reader X there were no issues opening these files. Since the update to Reader X the documents now take, depending on the circu