Query Designer: Calculate a % based on two other totals

Hi Gurus,
Here is the scenario of my query:
A     B     C     D     E
2      3     6     4     150%
1      2     2     4     50%
2      2     4     8     50%
1      1     1     10   10%
6      8     13    26   50%
Column C is calulated by AB and I am able to get the total 13 instead of 48 (68) by using the "Total" calculation function.
The problem is about the Total of Column E. It is a % based on columns C versus D. There's no problem for individual results, but for the total I cannot get the 50% because my query calculates the total result comparing 48 (6*8) Vs 26.
If I also use the Total function for the E Column, what it shows is an addition of all the individual results, so 260%.
I can't find the way to get the Total 50% that takes the "Total" function of Column C and Column D.
Please, any idea so solve this scenario?
Many thanks!!
Regards,
Jordi

Hi,
The "Calculate Result As" is a Display option. That value is not considered in the calculations, only for display.
You may try "Exception Aggregation" , 'Total' for Column C with Ref Characteristic being the Char at the lowest level of which you see the data and try.
For eg: you can to calculate A x B for Materials, but at all levels higher than material you want A1 x B1 + A2 x B2 + .....
Then you create CKF/Formula C = A x B with Exp Aggregation, Total, Ref Char = Material.

Similar Messages

  • Query Designer: calculate relative revenue

    Hi,
    I would like to calculate the relative revenue (= revenue / revenue of the biggest market participant) in the BEx Query Designer. I have a key figure "revenue" and my market participant as characteristic.
    I first tried to create a formula like "revenue / max(revenue)" but this doesn't work that way in Query Designer. I now tried to solve this with a calculated keyfigure but don't come to a solution.
    How can I do a calculation like this in Query Designer?
    Thanks!

    Create a 'Replacement Path' variable having reference to 'Market Participant' characteristic. Use this variable in your formula and use the Max. function on 'Market Participant' variable.
    Hope this helps.

  • Find missing values in third table based on two other tables

    Hi- I have tried to do this on my own but the answer eludes me. Can someone please point me in a better direction? We have a table project_categories with project_IDs and related project category_IDs. We have another table contact_categories with contact_IDs and related contact category_IDs. We use these two tables to link contacts to projects by at least one category_ID. It works well for email notifications. We have a third table for "planholders" who are interested in particular projects. The planholder table has contact_IDs and related project_IDs. I want to find contacts who have expressed interest in a project, by inserting a row in the planholder table, but they have not selected any of the project categories in contact categories. This would be an unusually rare exception, so to test it I added myself as a contact 100010 and as a project "planholder", but deliberately did not select any of the related project categories in contact categories.
    select ph.contact_id, ph.project_id, pc.category_id, cc.category_id
    from purchasing_planholder ph, purchasing_project_categories pc, purchasing_contact_categories cc
    where ph.project_id=pc.project_id
    and ph.contact_id=cc.contact_id
    and ph.contact_id||ph.project_id||cc.category_id
    not in (select ph.contact_id||pc.project_id||pc.category_id
    from purchasing_planholder ph, purchasing_project_categories pc, purchasing_contact_categories cc
    where ph.project_id=pc.project_id
    and ph.contact_id=cc.contact_id)
    and ph.contact_id=100010
    This gives me every category for the test contact and every category for the project. I want to find contacts in the planholder table who have not selected any of the categories related to the specific project they selected in the planholder table. I tried minus, outer joins, etc. Does this require PL/SQL and a temp table, or can I find the exceptions with a report? Or do I need a different approach? The ideal answer would display one row with the contact_ID and the project_ID, where the contact has not selected any of the project categories. This would be used to alert them that they need to select at least one of the project categories on the contact form. Thanks for any feedback.
    Peter
    CONTACT_ID PROJECT_ID CATEGORY_ID CATEGORY_ID
    100010 701 1 19
    100010 701 1 18
    100010 701 16 19
    100010 701 16 18
    100010 701 21 19
    100010 701 21 18
    100010 701 24 19
    100010 701 24 18
    8 rows selected

    Hi User,
    When you Post a Question in Forum, Please be clear of the Inputs to be given, the expected output and the tries you made,
    the errors/results you faced.
    Also, see this link of BluShadow.
    SQL and PL/SQL FAQ
    Please enclose the query or programs in code tags for a formatted code.
    Just Try something like this,
    SELECT *
      FROM emp c
    WHERE NOT EXISTS (SELECT *
                         FROM emp a
                        WHERE EXISTS (SELECT *
                                        FROM emp b
                                       WHERE a.empno = b.empno));In the Inner Query, the conditon checked is empno same in both the tables, and for example some rows are obtained, other than
    this rows all other results are obtained from the outer query.
    In the above case no rows are returned.
    Thanks,
    Shankar

  • How to calcluate a filed based on two other fields after TABING out.

    Hi,
    I need my third field be calculated based on the previous two fields after tabing out from each field.
    Price Quantity Amount
    12 10 120
    Both price and Quantity is text box and amount is readonly.I want if I change Price from 12 to 15 and tab out then amount should automatically get changed to 150.
    Regards,
    Prakash

    I believe you can use Partial Page Rendering (PPR) to accomplish this. You'd place a 'firePartialAction' event on the input field. This event would fire when you tab out and then you can invoke controlelr logic to set the other two fields appropriately.
    Check out the OA Framework Developer's Guide for examples.

  • How to calculate value based on two fields & set that 3rd on (KFFfields)

    Hello Gurus,
    I have a requirement customization in which, in an OAF page, tableLayout: (HrSitKeyFlex) having 3 fields 1)Days of Trainging 2)No of days Trainging hours 3)Total Duration when user enter the values for two fields say 'Days of Trainging' and "No of days Trainging hours "and immediately on tab out, the 3rd field should be popluated as rate*Toatal'.
    tableLayout: (HrSitKeyFlex)
    1)Days of Trainging ( 1DAY)
    2)No of days Trainging hours (4Hours)
    3)Total Duration (calculate 1*4=8)
    Is there a way, we could capture the tab out event? Or any way we could achieve this?
    This is really urgent.
    If anyone can help.
    Regards,
    Srini

    Hello,
    1. Firstly set the fire partial event of 2nd column field.
    2. Capture the event in PFR method.
    3. After Capturing event, make a row reference object.
    4 Now store the value of 1st column field and 2nd column field in variable.
    eg. String str= row.getAttribute("Ist Column Name")+"" and String str1= row.getAttribute("2nd Column Name")+""
    5.Convert these string value into integer
    eg. int x=Integer.parseInt(str); and int y=Integer.parseInt(str1)
    6. calculate the value in the integer variable on the basic of these two value
    eg. int z = x*y
    7 Assign the value to 3rd column after converting it into string
    eg. row.setAttribute("3rd Column Name", string variable);
    when u tab out from 2nd column, the calculating value will be assign to 3rd column.
    Regards,
    Manish Chawla
    Edited by: ManishC on Dec 17, 2012 10:36 AM

  • BEx Query Designer: Calculate result as Problem

    Hi Experts!
    I have a trouble with calculating result for one field in report desiner.
    Scenario
    Fomular:   Price = Amount/Qty
    Amount        Qty         Price                   
            5           2               2.5

    Hi experts,
    I have a trouble with calculating result for one field in report desiner.
    Scenario
    Fomular:   Price = Amount/Qty
             Amount -
    Qty----
    Price                   
                      5 -
    2 -
      2.5
                      6----
    4 -
    1.5
                      8--5--
    1.6
    Result        19          11               ?
    Required result ? = 19/11, please some advice how can I get required result? How can I calculate thish result?
    Thanks in advance,
    Luu

  • How to calculate value based on two fields & set that on the 3rd (in table)

    Hi OAF Gururs
    I have a requirement in which, in an OAF page, the user can add a row in an advanced table and they enter
    the values for two fields say 'rate' and 'entered amt' and immediately on tab out, the 3rd field should be popluated as rate*entered amt.
    Is there a way, we could capture the tab out event? Or any way we could achieve this?
    This is really urgent.
    If anyone can help.
    Thanks!
    AJ

    OAF gurus hang out over in {forum:id=210}

  • Need Trigger that format a field based on two other fields

    Hello!
    I need to write a trigger, that reads on field and made some changes to it and saves the result in an other field in the same row. The trigger should work in insert and update cases.
    Does anybody can send me a frame, where i can fill my logic?
    Regards
    Heiko Glaeske

    In this example, column1 and column2 are the values being examined and the resultant expression is saved in column3.
    create or replace trigger trigger_name
    before insert or update on table_name
    for each row
    begin
      :new.column3 := :new.column1 + :new.column2;
    end;
    /

  • How to merge text attribute in query designer

    Hi,
    please does anybody know, how to merge, let say, two text attributes of one characteristic into one long text? I know, that it is possible with method, which is finally called in the Web Application Designer. But I need to proceed this on the query level. It means, when I display result of query in query designer, I need to have two attributes merged into one long text. Is there some exit, method or something else, where can I do it?
    Thank you very much
    Best Regards
    J.

    Hello,
    I don't think so we have string concatenation at query level.
    You have to create / use existing info object and use string functions to achieve this.
    Might be you could wait for some time to get more replies.
    Regards,
    Venkat

  • BW query designer - create formula using percentage variable

    Hello BW Experts! 
    I am using Business explorer query designer 7.x (based on 7.2) and I want need to create a formula based on 1 KF and a variable that the user would be able to enter when running the query.  The variable I want to pass is a percentage that will change each time they run the report and then I will multiply that percentage by the desired KF.  Any ideas?
    Thanks in advance,
      Jim

    hi Jim,
    you can achieve this using formula variable. This variable is going to be user entry variable and you can use that variable for further calculation, in your case for formula.
    thanks.
    Wond

  • Number of records in cube from Query Designer

    I don't have access to the cube in BW(listschema). I only have access to pull reports from cube from Query Designer. How can I tell the total number of records in a cube?
    Thanks.

    Hi
    you can use the tech content in the query designer to display the count for no of records or you can do the same via creating a new CKF
    or see the below link to display the count
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/009819ab-c96e-2910-bbb2-c85f7bdec04a

  • Combine two reports in query designer using key figure with sap exit

    Hi experts,
    i want to combine two reports in query designer using key figure with sap exit
    in the report 1 key figure calculation based on the open on key date(0P_DATE_OPEN)
    to calculate due and not due in two columns
    in report 2 key figure calculate in the time zones using given in variable Grid Width (0DPM_BV0) like due in 1 to 30 days, 31 to 60 days...the due amount based on the open on key date(0P_DATE_OPEN)
    to calculate in 1-30, 31-60, 61-90, 91-120, 121-150 and >150 days in 6 columns
    now i have requirement like this
    not due, 1-30, 31-60, >60, due,1-30, 31-60, >60 in 8 columns
    or
    not due, due, 1-30, 31-60, 61-90, 91-120, 121-150 and >150 in 8 col
    thank you

    Hi Dirk,
    you perhaps know my requirement,
    for the management to make used in one report,
    we have in reporting finacials Ehp3.
    Vendor Due Date Analysis - which show due, not due
    Vendor Overdue Analysis - show only due and analysis in time grid frame
    i want to combine in one report that show NOT DUE, DUE, DUE time frames in grid.
    krish...

  • Combine two reports in query designer

    Hi experts,
    i want to ombine two reports which are using key figure with sap exit in query designer
    in the report 1 key figure calculation based on the open on key date(0P_DATE_OPEN)
    to calculate due and not due in two columns
    in report 2 key figure calculate in the time zones using given in variable Grid Width (0DPM_BV0) like due in 1 to 30 days, 31 to 60 days...the due amount based on the open on key date(0P_DATE_OPEN)
    to calculate in 1-30, 31-60, 61-90, 91-120, 121-150 and >150 days in 6 columns
    now i have requirement like this
    not due, 1-30, 31-60, >60, due,1-30, 31-60, >60 in 8 columns
    or
    not due, due, 1-30, 31-60, 61-90, 91-120, 121-150 and >150 in 8 col
    thank you

    Hi,
    Have you tried APD?
    You can combine them using workbook or from a multiprovider query. APD is another option. Have a look at these APD docs:
    In APD, you can take input from two queries, then combine them and load to another object (DSO).
    [Analysis Process Designer |https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/413ba6c1-0d01-0010-1980-ec450e30f23c]
    [AGSAP NetWeaver 7.0 Application Process Designer|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b06c3f96-ed4f-2a10-1693-f2c76a39988f]
    Let me know where you r stuck...
    Regards,
    Ashish

  • Query Designer: Ideas how to calculate remainng weeks?

    Hello!
    I'm fairly new to BI, so bear with me...
    I'm creating a query and I need to have a column that calculates a correction value for a weekly target value.
    The general idea is a very simple logic. Based on previous year's net sales a 10 % increase is the target level for the current year. But if current sales are lower than the set target, I would need to create a logic that raises the target for the remaining weeks of the current year.
    In other words, if  01.2006 the sales were 10, then the target for 01.2007 is 11. If sales in 01.2007 are only 9, the sales target has to be higher for the remaining weeks to reach 10 % yearly growth in sales.  So the weekly addition to the target values for weeks 02.2007 - 52.2007 would be 11+(11-9/remaining weeks).
    Any ideas on how to solve this in query designer? BI version is 7.0.
    Points rewarded naturally!
    Thanks in advance,
    Antti

    Hello Antti,
    You have essentially done the hard part which is define what you actully need in your query.
    My advice to you (and there would be many ways to do what you require) would be to create a "Calculated Key Figure"
    So using your example your calculated key figure should be,
    TARGET + (TARGET - ACTUAL / "REMAINING WEEKS")
    REMAINING WEEKS I would create a variable, without going into too much detail here are two sites which I have found useful in the past.
    http://help.sap.com/saphelp_nw04/helpdata/en/61/579b3c494d8e15e10000000a114084/content.htm
    and
    http://help.sap.com/saphelp_bw33/helpdata/en/f1/0a56a7e09411d2acb90000e829fbfe/frameset.htm
    Hope this helps Antti
    Regards
    Ben

  • Results based on From and To value in Bex query designer.

    Dear all,
    We are using BI7.00. In one of our report which pertains to PM user wants to get the details of number of breakdowns which falls in the value range 0 to 1 hours.
    I created a condition which has 2 variables, one is From value and the other is for the To value (since user wants to enter both the limits). I have written a condition that if the breakdown hour is greater than or equal to variable1 and less than or equal to variable2.
    Using the above condition if the query is run, i am not getting the desired output. The values avaialble in the report are 0.65,0.78,1.30,7.38,0 etc., when i give 0 to 1 i should get the values 0.65,0.78 and 0 but instead report displays "No valid results".
    I changed the condition and selected "Between" variable 1 and variable 2 - yet no change in the query.
    To my knowledge i foresee that system is not able to recognize the decimal and hence provides details only based on the whole numbers.
    How to get my requirement achieved in the Bex query designer.
    Experts suggestion with steps will be very useful to solve my problem.
    Regards,
    M.M
    Edited by: Magesh Magesh on Dec 26, 2008 11:28 AM

    Hi Magesh,
    I think you could try one more way.
    Create a formula inserting your two formula variables for limits .(FV -  are ready for input ) .
    The formula would return the result as 1 or 0 because it would have boolean condition in it.
    You could then place a condition in the query designer to only show all records where the value of the formula key fig is 1.
    You formula A would look like
    ( KF > FV1) AND (KF < FV2) * 1.
    And in the condition put A EQ 1.
    You could scale the key figures as well and multiply the limits mentioned by the users in FV1 and FV2 if decimals are still not recognized by SAP.(scaling)
    Regards,
    Sunmit.

Maybe you are looking for