Problems in calculating querys

I have a query for which data are in a infocubo and I pass the following:
I have records of the type:
City Stock Price
New York 2 100
New York 1 50
And I want to make the value of the stock, but when you add the query by New York draws 450 proved that squeezes to add the stock and add the price and multiply. And what I want is that the operation is performed by recording and then add, ie 2 * 100 = 200 and 1 * 50 = 50, Total = 250.
Please tell me how I can get it.

Hi Agustin,
Calculations of these kinds are always inconsistent at the report Level.
Can you please tell me will you be loading data to your ODS ? If not there is another solution. You can create a datamart of your ODS and assign it to itself and reload data after adding a new KF.
Here you will again have a problem since it is an ODS and if your Key Fields are same then it might add up/ replace the existing data.
If your ODS is used only for historical data you can do one thing. You can keep a flag infoobject as one of the keys and reload the data again.
Regards,
Pramod

Similar Messages

  • Problem in Calculation

    Hi Experts,
    I am doing a report on opening and closing stock with subcontractors and i am facing a problem in calculation of two fields manually.
    for eg:
    I am having MATNR  (Finished goods)  and its corresponding  MATNR (raw materials)  in another field. Each finished goods  have multiple  raw materials .
    So in my out put I am sorting the finished goods as per the raw materials.
    For finished goods am displaying  its MENGE  and for raw material  its corresponding
    STPO-MENGE  which differes for each raw material of a single finished good.
    And I am facing a problem in multiplying these different STPO-MENGE with single MENGE of finished goods.
    Please advice,
    Karthik

    Hi,
    I want to multiply finished good menge with raw material menge , both the menge are from different
    tables.
    eg - A pen is finished good and  its raw materials are top , refill etc.
    Matnr  (finished goods)  =  Pen  ,  Menge =  2 and its corresponding raw materials are:
    Raw mat1 - its Menge is  5
    Raw mat2 - its Menge is  3
    Raw mat3 - its Menge is  2.
    Now I have to multiply these whole raw mat menge with finished goods menge ie 2.
    But when I tried only the first line ie Raw mat1 is getting caluclated.
    Please advice.

  • OBIEE 11G - problem with calculating percentage

    Hi,
    I have a problem with calculating a percentage....
    I have a 2 measures Success and Failure
    where Success is a count(Response_key)
    Failure is a count(failure_key)
    I want Success/(Success+Failure) * 100
    I am getting this value as a 0
    Infact any column I take from the subject area and say count of that column and divide it by any integer say count(column1)/5 ,Say count of that column1 is 132 Eg: 132/5 , Its showing this value as 26.00 when I put decimal value to 2 , but it is 26.4...It is avoiding decimal values .
    So in my case success/(success+failure) in which Dr is greater than Nr . Since we get the value as 0.something . It is showing 0 value
    So , 0*100 it is showing me as 0%
    Can anyone please help me on this ??
    --Siri                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Yes, you need to put cast in numerator alone to get the resultant output in double.
    You can mark the post as Correct since your issue is resolved now.
    Thanks

  • Hello I have a problem in calculating the apple id Can you help me please   I forgot answer security questions for your account How can knowledge Please help Please reply as soon as possible   I can not buy from camels Store And the rest of the account ba

    Hello
    I have a problem in calculating the apple id Can you help me please
    I forgot answer security questions for your account How can knowledge
    Please help
    Please reply as soon as possible
    I can not buy from camels Store
    And the rest of the account balance  $25
    Message was edited by: lingo azam

    I think you mean App Store.
    Rescue email address and how to reset Apple ID security questions

  • Problem in Calculated Key Figure in BEx 7.0

    Hi All,
    In Bex 7.0
    We have a requirement where we need to display a key figure which is having unit price of an Article. In our InfoProvider we have Article, Store and Date and the report is based on Article. As we have to display only the latest price we have created a RKF by putting a restrcition of the latest date in the date range on the the unit price key figure. But still unit price is getting aggregated over stores.
    For example if there are 10 stores and the unit price of an article is 5, then data displayed is 50 and not 5.
    We tried to create a Calculated Key Figure using the above RKF and an exception aggregation Average of all detailed value that are not zero, null or error on reference characteristic 0PLANT. Its working fine when the query is restricted to one or two Articles. But for all the articles it gives the following error messages.
    1. Error while reading data; navigation is possible.
    2. Error occurred during parallel processing of query 17; RC3
    3. Error executing physical plan: AttributeEngine: no 6952
    4. Error reading the data of infoprovider ZXMSC01$X
    5. Amount of data that is to be read from the BIA server is too large
    6. The following error 6952 occurred in BIA server
    7. Error executing physical plan: AttributeEngine: not enough memory;BwPopMerge pop1(setIsLastMerge(1)),in executor::Executor in cube: p03_zxmsc01
    Can anyone tell me the solution for the above error. Or if there is a workaround to our requirement.
    Regards,
    Sachin

    Hi,
    Could be a memory issue.
    One of your cube in on BIA which is causing the Problem.
    So executing the query in RSRT by selecting Do not use BIA index option.
    If the query is executed with out any issue then take the cube out of BIA and push it back.
    Hope it helps.
    Regards,
    Raghu
    P.S : Also please let us know if this query is live and it is an issue that you are facing after executing it properly for few days.
    Or this is a new query created and testing now and in the process got this error?
    Edited by: Raghu tej harish reddy on Sep 24, 2009 5:53 AM

  • Problem with calculated column, everything inc. NULLs appear

    Good morning,
    This one is tough.
    I have a dimension Category (with categories: Fruits, Vegies, Canned, etc.). And in my fact table I have field Expense. Then I decided to create calculated fields like "Fruits Expense" -
    CASE WHEN Dim."Category" = 'Fruits' THEN Fact.Expenses "."Expenses $ CY" END
    There're 2 problems:
    A) if the field Category isn't dropped in Answers there're many NULLS (all Exp values which don't belong to 'Fruits')
    B) If Category isn't there, there're even more NULLs - which don't look good at all - there're too many empty values
    Of course, it's possible to train users to use filters (is not null), etc. - but then it's really not what OBIEE is good at.
    Can someone suggest a better approach?
    I proposed in the beggining to create fields in the DB like "Expense Fruits" - but ut was deemed too complicated on ETL side.
    Thank you and have a wonderful OBIEE day
    UPD: OK, I want to rephrase it and make it easier. Except for using "is not null" filter- is there any other way to supress NULL values? I'm getting 12 empty ones and 1 i need. Is there anything I could do in order to supress showing NULL values by default. Thanks
    Message was edited by:
    wildmight
    Message was edited by:
    wildmight

    Thank you Nilanshu! Where have you been! I'm already seeing quite a few useful contributions. I'll try to go ahead and test your suggestions and I'll report what I've found.
    P.S> It works like a charm. Thank you
    Message was edited by:
    wildmight

  • Problem in calculating opeing and closing balance in fi report

    Hi all,
    I am developing customised FBL3N report as per our client requirement.I searched standard function module for calculating opeing balance for given gl account but didn't find it. so, for calculating opening balance we are using following logic.
    SELECT
                  A~BUKRS
                  A~HKONT
                  A~AUGDT
                  A~AUGBL
                  A~ZUONR
                  A~GJAHR
                  A~BELNR
                  A~BUZEI
                  A~BUDAT
                  A~BLDAT
                  A~WAERS
                  A~XBLNR
                  A~BLART
                  A~SHKZG
                  A~DMBTR
                  A~WRBTR
                  A~SGTXT
                                   FROM BSIS AS A INNER JOIN SKA1 AS B
                                   ON AHKONT = BSAKNR
                                   INTO TABLE IT_BSIS1
                                   WHERE A~BUKRS IN SO_BUKRS
                                   AND   A~HKONT IN SO_HKONT
                                   AND   A~BUDAT < SO_BUDAT-LOW
                                   AND   A~BLART IN SO_BLART
                                   AND   A~GSBER IN SO_GSBER
                                   AND   B~KTOKS IN SO_KTOKS.
    I am using following code for getting accounting documents for given gl account.
    SELECT
               A~BUKRS
               A~HKONT
               A~AUGDT
               A~AUGBL
               A~ZUONR
               A~GJAHR
               A~BELNR
               A~BUZEI
               A~BUDAT
               A~BLDAT
               A~WAERS
               A~XBLNR
               A~BLART
               A~SHKZG
               A~DMBTR
               A~WRBTR
               A~SGTXT
                       FROM BSIS AS A INNER JOIN SKA1 AS B
                       ON AHKONT = BSAKNR
                       INTO TABLE IT_BSIS
                       WHERE A~BUKRS IN SO_BUKRS
                       AND   A~HKONT IN SO_HKONT
                       AND   A~BUDAT IN SO_BUDAT
                       AND   A~BLART IN SO_BLART
                       AND   A~GSBER IN SO_GSBER
                       AND   B~KTOKS IN SO_KTOKS.
    For closing balance I am doing sum of opening balance and amounts of accounting documents for given gl account.
    the problem we are facing is they want output in following format.I am not able to club all this data as per desired output.
    please help me to achieve this.
    01.06.2011     01.06.2011     Op.Bal.          0835810021     0.00     13,258.00     0.00     13,258.00
    30.05.2011     03.06.2011     0008000005     001     0835810021     24,500.00     0.00     24,500.00     0.00
                   0          0.00     25,000.00-     0.00     25,000.00-
                   003          500.00     0.00     500.00     0.00
    01.06.2011     01.06.2011     Op.Bal.          0835810021     0.00     13,258.00     0.00     13,258.00
    30.05.2011     03.06.2011     0030000072     001     0835810021     72,141.72-     0.00     72,141.72-     0.00
                   0          0.00     73,614.00     0.00     73,614.00
                   003          1,472.28-     0.00     1,472.28-     0.00
    01.06.2011     01.06.2011     Op.Bal.          0835810021     0.00     13,258.00     0.00     13,258.00
    04.06.2011     04.06.2011     0030000084     001     0835810021     25,000.00-     0.00     25,000.00-     0.00
                   0          0.00     24,038.46     0.00     24,038.46
                   003          961.54     0.00     961.54     0.00
    01.06.2011     01.06.2011     Op.Bal.          0835810021     0.00     13,258.00     0.00     13,258.00
    23.06.2011     23.06.2011     0012000089     0     0835810021     0.00     10,000.00     0.00     10,000.00
                   002          10,000.00-     0.00     10,000.00-     0.00
    30.06.2011     30.06.2011     Cl.Bal.     999     0835810021     0.00     82,652.46     0.00     82,652.46
    Thanks in advance.
    Regatds,
    Sheela Patil
    Edited by: Sheela Patil on Nov 1, 2011 8:42 AM

    Hi,
    As far as i know, you must be getting all required data to be displayed in an internal table.
    What you need to do is just loop on it and use WRITE statement appropriately.
    Please see sample code below : This code is adding 1,2,3.... no before data in work area.. simily, you can add Opn Bal and Cl Bal etc appropriately.
    REPORT  ZTEST_RAHUL.
    DATA : i_no TYPE n.
    TYPES : BEGIN OF t_temp,
            name TYPE char20,
            roll TYPE numc10,
            END OF t_temp.
    DATA : i_temp TYPE STANDARD TABLE OF t_temp,
           wa_temp LIKE LINE OF i_temp.
    CLEAR wa_temp.
    wa_temp-name = 'Rahul'.
    wa_temp-roll = 26.
    APPEND wa_temp TO i_temp.
    CLEAR wa_temp.
    wa_temp-name = 'Mahajan'.
    wa_temp-roll = 27.
    APPEND wa_temp TO i_temp.
    i_no = '1'.
    LOOP AT i_temp INTO wa_temp.
      WRITE : i_no , ',' , wa_temp.
       NEW-LINE.
      i_no = i_no + 1.
    ENDLOOP.
    I know this may not be favourite answer to your question but can be used.
    Also, there is 1 more way to write a custom report and that is by writting a Wrapper report which will be just copying the selection screen from STANDARD CODE and then submitting standard code from wrapper code and return back.
    I hope this will help you.
    Regards,
    Rahul Mahajan

  • Currency translation problem for calculated key figure

    Hi All
    I have a problem with the currency translation for a calculated key figure.
    I have a requirement to show the MM consignment stock value in the specified currency from the selection screen.
    For consignment stock, there is no value maintained in the system. So for this we need to calculate the value as below
    Restricted key figure: RKFConsignment stock: Total stock with special stock indicator restriction "K"
    Calculated keyfigure: Consignment stock value = Nodim( RKFConsignment stock) * (Standard cost / price unit).
    Here, in the calculated keyfigure properties --> I have used a currency translation for the 0CALMONTH.
    The query has selection on the 0calmonth.
    But in the result the I am getting unexpected results.
    Do we have any inconsistencies in the currency translation on the formulas?
    Please help me on this.
    Regards
    S.R

    Hi All
    I have noticed something. I changed my query date selection to Calendar day - Keydate instead of calendar month.
    And I have changed the currency variable to fixed exchange rate "CHF", it is working fine.
    I think I have some problem with the currency translation variable.
    Could anyone of you please send me the currency translation variable for Calendar month with the below parameters
    exch rate  type :  M
    Time reference : 0CALMONTH
                               End of month
    Target currency for a variable : < var created on 0currency>
    For my report,  i need calendar month selection, currency selection.
    Please help me with your ideas.
    Thank you
    Regards
    S.R

  • Problem at calculation time, when using Dynamic Calc measures

    Hello,<BR><BR>We are using Essabse v6.5 and we want to upgrade to v7.1.<BR>we are performing some tests, in order to check that the Cubes we have created in 6.5 are working properly in v7.1.<BR><BR>the problem that we are experiencing is that the calculation time for the cubes that have dynamic calc members has exploaded to 10 times more, compared to what it took at version 6.5.<BR><BR>Do you have any idea why this happens. (also we are still using the old client "Application Manager")<BR><BR>Furhermore, I have set up 2 cubes that are the same, except the 1st has dynamic calc memebers, whereas the 2ns has not.<BR>I perform calcualtions with the “SET MSG DETAIL;” and receive the following:<BR>CUBE (A) with Dynamic Calc<BR>Total Block Created: [4.3720e+03] Blocks <BR>Sparse Calculations: [8.0620e+03] Writes and [2.5338e+05] Reads <BR>Dense Calculations: [2.8000e+01] Writes and [2.8000e+01] Reads <BR>Sparse Calculations: [6.0202e+06] Cells <BR>Dense Calculations: [1.1476e+06] Cells <BR><BR>CUBE (B) withOUT Dynamic Calc<BR>Total Block Created: [4.3720e+03] Blocks <BR>Sparse Calculations: [4.3720e+03] Writes and [3.5887e+04] Reads <BR>Dense Calculations: [2.8000e+01] Writes and [2.8000e+01] Reads <BR>Sparse Calculations: [6.0202e+06] Cells <BR>Dense Calculations: [1.1476e+06] Cells <BR><BR>Question: Why does Cube (A) has more “Sparse Calculations” than Cube(B) ????<BR><BR><BR>thanx

    Yes, all the settings were exactly the same. See following:<BR>- Data Cache (note: we are NOT using the Data File Cache) <BR>- Index Cache<BR>- Index Page<BR>- Commit Block Interval<BR>- Cache memory Locking<BR>- Access Mode = buffered IO<BR>- Data Compression = Bit-Map encoding<BR>- Two Pass Calculatino = ON<BR>- Aggregate Missing Values = ON<BR>- CFG file<BR><BR><BR>Is there any new settings in 7.1 that I must configure?<BR>Is there any settings that I cannot see through the old client Application Manager, which is important? Must I install the new client in order to be able to configure correctly the Outline/Cube?<BR><BR>Thnkx<BR><BR>

  • Decimals problem after calculation

    Hi All,
    I am facing an issue with decimals after calculation.
    Below is my calculation.
    l_sales_amt_round = lwa_post_data-cccur_sale +
                        ( lwa_post_data-cccur_sale *
                          wa_post_data-taxper ).
    Here lwa_post_data-cccur_sale has 2 decimals
           wa_post_data-taxper  has 3 decimals.
    Result variable l_sales_amt_round of type f. ( Tried with TYPE P DECIMALS 3).
    Is there any way to extract only the first 2 decimals into an amount field. I dont want this in character field.
    eg: lwa_post_data-cccur_sale  = 4854.00
          wa_post_data-taxper  = 0.175
    Then l_sales_amt_round =    5.7034499999999998E+03
    But when i move this to TYPE P DECIMALS 2 it is rounding to          5703.45.
    But my requirement is to get          5703.44.
    Is there any way to achieve this.
    Thanks,
    Vinod.

    Hi,
    Thanks for the responce.
    I have solved the problem on own as below.
          l_sales_amt_round =  ( lwa_post_data-cccur_sale *
                                 wa_post_data-taxper ).
          CLEAR l_tax_amt.
          MOVE l_sales_amt_round TO l_tax_amt.
          SHIFT l_tax_amt RIGHT.
          SHIFT l_tax_amt RIGHT.
          MOVE l_tax_amt TO l_sales_amt_round.
    Here l_tax_amt is char field.
    Thanks,
    Vinod.

  • Problem in calculation with web analysis

    Hi, Experts..
    Here is an interesting quetion...with Web Analysis
    I need to calculate mat ov/kg for a site which is obatained by (total value/total volume). When i went for calculation option in analysis tool manager and apply formula this,It is taking for only one site calculation not happening for the other sites.Totally we have 60 sites with us and would not be flexible to calculate it individually.
    Is there any possibility to run calc scripts...in web analysis... or how to solve this problem?

    It might be because you have set up the 60 sites individually within the Web Analysis grid? We had some difficulty when first using Web Analysis and needed to put the calculations at the highest level using the calc manager. You also have to be careful if there are lots of columns, due to the way the calculation manager applies calcs and formats due to the inheritance.
    Another option would be to push the calculation back to the cube, which is best practice as it's easier, more scalable for deployments.

  • Problem with Calculations created in Analyzer Views

    Hi,I have to create a view looks as follows Y2001 5000 Act Bud Variance=================================================Sales 200 100 100(Act-Bud)Margin 300 400 -100(Act-Bud)Expense 500 600 100(Bud-Act)Here i am bring row names from one dimension andAct and Bud members from scenarion dimension. I created a calculation field i.e "variance" on screnario dimension.Is there any way to create this variance field as shown above. While calculating for sales and Margin rows i want to use "Act" - "Bud" and for Expense i want to use "Bud" - "Act".This is very much important from business perespective. Did anybody got this type of problem?.Do you have any suggestion?.I would appreciate any help given or any suggestions.Thanks a lot in advance..Regards..Rao

    The easiest way to solve this is to add a dynamic calc member in the Essbase outline for the variance calculation. You need to use the @var function and set Expense reporting tag for all expense accounts in the outline.-Magnus---Message Posted by meetrao   3/29/02 07:41---Hi,I have to create a view looks as follows Y2001 5000 Act Bud Variance=================================================Sales 200 100 100(Act-Bud)Margin 300 400 -100(Act-Bud)Expense 500 600 100(Bud-Act)Here i am bring row names from one dimension andAct and Bud members from scenarion dimension. I created a calculation field i.e "variance" on screnario dimension.Is there any way to create this variance field as shown above. While calculating for sales and Margin rows i want to use "Act" - "Bud" and for Expense i want to use "Bud" - "Act".This is very much important from business perespective. Did anybody got this type of problem?.Do you have any suggestion?.I would appreciate any help given or any suggestions.Thanks a lot in advance..Regards..Rao

  • Problems!:  calculated fields in Adobe Forms using the ISR/PCR framework.

    Hi there,
    I have made an Adobe form in the ISR framework. Everybody who is familiar with these forms in the framework knows that the adobe form is embedded in a standard webdynpro which consist of a roadmap with three steps.
    Step 1: Fill out the form
    Step 2: Check and fill the form
    Step 3: Submit the form. After submit the form can be send to a manager or can be directly processed in SAP HR.
    Problem 1:
    When I test the adobe form and fill in a number in a field and click on next everything goes fine. But when I click on previous step the value which I filled in before is gone and put to 0,00.
    Problem 2:
    Also another problem is that calculated fields, do not show directly when clicking on next step. When you click on next step and then previous step, then you see the value of the calculated field.
    Problem 3:
    Also another problem is with the calendar function. When I fill in a date by hand and click on next the BADI behind the form sees 00-00-0000. When I use the calendar function everything goes well.
    Who can help me with these 3 problems.
    Greetings.
    Message was edited by: Sandhya Banwarie

    Hi Phil,
       Interesting - I have a similar issue.  We want to use the Request for Transfer scenario in ERP 2005, but it has not been developed in Adobe forms by SAP yet (it isn't available in 2004 either)!  So, we have decided to use the old JSP PCRs instead.
    Your issue is probably because you're using the same 2005 iviews to create your PCRs.  The 2005 PCR iviews are written in WebDynpro, and appear to assume that each one will be an Adobe form!  If you assign the old PCR iviews to your manager (give them the old MSS role under Migrated Content->EP5.0... in the pcd if you have it installed), you will be able to create a PCR with the JSP forms (regardless of the "Entry in Web" setting in QISRSCENARIO).
    The next issue is the approval.  In 2005, transaction SWFVISU has task TS50000075 configured as Java Webdynpro.  You'll need to change that to iView, and specify ID = com.sap.pct.hcm.isrdispatcher.default.  I'm following the UWL item type guide for this at:
    http://help.sap.com/saphelp_nw04s/helpdata/en/b1/cc1357eead454bb144face4a66be7d/content.htm
    Having said this, my approval is not working!  The item type has clearly changed, because the workitem name is no longer a hyperlink (rather annoying), but when I hit the "Launch Task Page" button (default name I think) I get the error:
    "Unable to perform action because the system returned an invalid URL"
    I can't see this "invalid url" anywhere in the logs, so I can't see where it is getting it from, or what path, etc I'm meant to put!  In your old system, what did you have as the "Server for ISR call" under "Additional Data for Scenario" in QISRSCENARIO?  Also, what did you have in the "URL" box that appears under the Additional Data for Scenario button when you change the Entry Type to JSP?
    Many thanks,
    Russell.

  • Problem while calculating time before 5 years

    Dear all,
    See the following code. Here i tried to calculate the time before 5 years.
    import java.util.Date;
    public class Test
            public static void main(String args[])
                    long threshold = -1;
                    long age = 5;
                    long currentTime = System.currentTimeMillis();
                    threshold = currentTime - (age*(365*86400000)); //  To calculate the time bef 5 years from now.
                    System.out.println("Threshold value(in Date) :: "+new Date(threshold));
    }The result is
    Threshold value(in Date) :: Mon Aug 06 05:42:55 IST 2007
    But when i change the code as follows
                    threshold = currentTime - (age*365*86400000); // Just removing the brackets before & after 365*86400000It's giving the correct result as follows:
    Threshold value(in Date) :: Thu Oct 31 09:12:21 IST 2002
    Why is it so?. Please explain me.
    Thanks.

    the problem is (I believe) due to int overflow.
    In your first calculation, your multiplication -- (365*86400000) is done with ints and will give an int result, an incorrect result because this will likely be greater than int allows, which on my system is 2147483647.
    the second calculation is a long * int * int, so the result will be a long which will not be corrupted.
    Try it yourself:
    public class Fubar2
        public static void main(String[] args)
            System.out.println(Integer.MAX_VALUE);
            int a = 100000000;
            int b = 500;
            System.out.println(a * b);
            System.out.println((long)a * b);
            a = 86400000;
            b = 365;
            System.out.println(a * b);
            System.out.println((long)a * b);
    }Edited by: petes1234 on Oct 29, 2007 8:53 PM

  • Carrier return problems within calculations

    Hi everyone
    Carrier return problems.
    I work with Numbers with Excel users, so I'm a victim of Excel.
    In my calculations I'd like to make carrier returns.
    As I understand it:
    Numbers understands: CHAR(8232)
    Exel understands: CHAR(10)
    Does anyone know of a CHAR() which both applications understand?
    Or
    Does anyone know of a calculation, so I can save it in Excel format troublelfree.
    The problem is, if I use the CHAR(8232) in an export of Excel the whole calculation is gone and only the product is left.
    Any input would be helpfull.
    Thanks.
    Jakob

    Numbers' CHAR function accepts numbers 32 and higher, except 127
    Excel's accepts the numbers 1-127
    The only solution I can think of is an error check.  In Numbers, 8232 will be used. In Excel, 13 will be used:
    IFERROR(CHAR(8232),CHAR(13))
    Note: I used 13 instead of 10 because 10 didn't seem to do anything for me in Excel.

Maybe you are looking for