Sum of current row and remaining rows

Hi Experts,
I have a requirement to pull the data like below.
ename salary expected_salary
ravi 10 250
kiran 20 240
uday 30          220
joe 70 190
anil 120           120
can you please help me.
i wrote a query like below
select ename, sal, sum(sal) over (ORDER BY sal desc ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) expected_sal
          from emp;

Hi,
ravt261 wrote:
Hi Experts,
I have a requirement to pull the data like below.
ename salary expected_salary
ravi 10 250
kiran 20 240
uday 30          220
joe 70 190
anil 120           120
can you please help me.
i wrote a query like below
select ename, sal, sum(sal) over (ORDER BY sal desc ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) expected_sal
          from emp;What's wrong with the query you wrote?
When I run it usin the scott.emp table, I get thse results:
ENAME             SAL EXPECTED_SAL
SMITH             800        29025
JAMES             950        28225
ADAMS            1100        27275
MARTIN           1250        26175
WARD             1250        24925
MILLER           1300        23675
TURNER           1500        22375
ALLEN            1600        20875
CLARK            2450        19275
BLAKE            2850        16825
JONES            2975        13975
SCOTT            3000        11000
FORD             3000         8000
KING             5000         5000Post the reults you want.
Point out where the results above are wrong, and explain how you get the right results in those places.
***** The part below isn;t quite right. See {message:id=10946897} *****
You don't need the windowing clause (that is, ROWS BETWEEN ...):
SELECT    ename
,        sal
,        SUM (sal) OVER ( ORDER BY  sal DESC
                            -- ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
                )            AS expected_sal
from      scott.emp
ORDER BY  sal
;will get the same results. If you like the windowing clause (e.g., if you think it makes the code clearer) then keep on using it; it won't change the results whether you use it or not.
Edited by: Frank Kulash on Apr 4, 2013 9:31 AM
Edited by: Frank Kulash on Apr 4, 2013 11:00 AM

Similar Messages

  • Sum from current date to the last date of sales

    Hi 
    It's been a while since I used MDX last time. 
    I have a simple question (probably). I need a measure which sums up from the current date to the last sale date. 
    It's like a reversal of Year To date.  And I need to do it date level. 
    Let's say is the sales goes like
    1/May/2000     $1000
    2/May/2000     $1000
    3/May/2000     $1000
    4/May/2000     $1000
    5/May/2000     $1000
    I need to create a measure which displays sum of current sales and last sales
    1/May/2000     $5000  
    2/May/2000     $4000
    3/May/2000     $3000
    4/May/2000     $2000
    5/May/2000     $1000
    I have a date hierarchy and hope it can be rolled up. 
    And I tried like something like ( suggested in another posting)
    [Date].[Calendar].CurrentMember:NULL}
    But this does not work for me.
    The actual MDx I wrote is 
    With member MEASURES.ActiveLicences as 
    sum ( 
    {[License Expiry Date].[FinancialYear].[YY-MMM].CurrentMember: null},
    [Measures].[No of Students]
    select {
    MEASURES.ActiveLicences,
    [Measures].[No of Students] } on columns, 
    [License Expiry Date].[FinancialYear].[YY-MMM].members on rows 
    from [Sales];
    Can anyone help me with this please? 
    Kind regards
    Mark Kim

    Hi SQLMa ,
    I was trying a similar code, using a hierarchy expression instead of a member expression for the CurrentMember functionality . Here is an Adventure Works example :
    With member MEASURES.ActiveLicences as 
    sum ( {[Delivery Date].[Fiscal].CurrentMember: null}
    , [Measures].[Internet Sales Amount]) 
    select {MEASURES.ActiveLicences,[Measures].[Internet Sales Amount]} on columns
    , [Delivery Date].[Fiscal].[Month].members on rows 
    from [Adventure Works]
    Hope it helps :)
    Regards, David .

  • Update Failed for Sum of previous row and current row

    Hi i need to update the column length of the previous row and current row so i followed this method but i'm unable to update what is problem in my syntax
    SQL> begin
    2 DECLARE Total number = 0;
    3 UPDATE StringOutput set Total = SumOfLength = Total + ColLength;
    4 end;
    5 /
    DECLARE Total number = 0;
    ERROR at line 2:
    ORA-06550: line 2, column 22:
    PLS-00103: Encountered the symbol "=" when expecting one of the following:
    := . ( @ % ; not null range default character
    if i update without the variable total then my command is succeeded
    UPDATE StringOutput set SumOfLength = ColLength;
    but i need the previous row+current row count in SumOfLength
    Thanks!

    Getting this error now
    SQL> begin
    2 DECLARE Total number := 0;
    3 UPDATE StringOutput set Total = SumOfLength = Total + ColLength;
    4 end;
    5 /
    UPDATE StringOutput set Total = SumOfLength = Total + ColLength;
    ERROR at line 3:
    ORA-06550: line 3, column 1:
    PLS-00103: Encountered the symbol "UPDATE" when expecting one of the following:
    begin function pragma procedure subtype type <an identifier>
    <a double-quoted delimited-identifier> current cursor delete
    exists prior
    The symbol "begin" was substituted for "UPDATE" to continue.
    ORA-06550: line 3, column 46:
    PLS-00103: Encountered the symbol "=" when expecting one of the following:
    . ( , * @ % & - + ; / at mod remainder rem return returning
    <an exponent (**)> where || multiset
    The symbol ". was inserted before "=" to continue.
    ORA-06550: line 4, column 4:
    PLS-00103: Encountered the symbol "end-of-file" when expecting one of the
    following:
    ( begin case declare end exception exit for goto if loop mod
    null pragma raise return select update while with
    <an identifier> <a double-quoted

  • ROWS BETWEEN 12 PRECEDING AND CURRENT ROW

    I have a report with the last 12 months and for each month, I have to show the sales sum of the last 12 months. For example, for 01/2001, I have to show the sales sum from 01/2000 to 12/2000.
    I have tried this:
    SUM(sales)
    OVER (PARTITION BY product, channel
    ORDER BY month ASC
    ROWS BETWEEN 12 PRECEDING AND CURRENT ROW)
    The problem is: this calculation only considers the data that are in the report.
    For example, if my report shows the data from jan/2001 to dec/2001, then for the first month the calculation result only returns the result of jan/2001, for feb/2001, the result is feb/2001 + jan/2001.
    How can I include the data of the last year in my calculation???

    Hi,
    I couldn't solve my problem using Discoverer Plus functions yet...
    I used this function to return the amount sold last year:
    SUM("Amount Sold SUM 1") OVER(PARTITION BY Products.Prod Name ORDER BY TO_DATE(Times."Calendar Year",'YYYY') RANGE BETWEEN INTERVAL '1' YEAR PRECEDING AND INTERVAL '1' YEAR PRECEDING )
    The result was: it worked perfectly well when I had no condition; so it showed three months (1998, 1999, 2000) and two data points (Amount Sold, Amount Sold Last Year). The "Amount Sold Last Year" was null for 1998, as there aren't data for 1997.
    Then I created a condition to filter the year (Times."Calendar Year" = 1999), because I must show only one year in my report. Then I got the "Amount Sold" with the correct result and the "Amount Sold Last Year" with null values. As I do have data for 1998, the result didn't return the result I expected.
    Am I doing something wrong??

  • Please help me on UNBOUNDED PRECEDING and CURRENT ROW

    Helllo Experts,
    Kindly help me on below query..
    SELECT
       SUM(n) AS month_amount,
      SUM(SUM(n)) OVER
        (ORDER BY n ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)
        AS cumulative_amount
      FROM t1
      GROUP BY n
      ORDER BY n;Here i need explanation over(what it does) over() and (ORDER BY n ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)And if you have any Docs over ANALYTICAL functions please help with them.
    Ur help ll be appreciated..
    Thanks
    Basav

    http://download.oracle.com/docs/cd/E11882_01/server.112/e26088/functions004.htm#SQLRF06174
    Regards
    Etbin

  • Difference between current row and previous row in a table

    Hi All,
    I am having a problem with the query. Can some of please help me?
    I need to get difference between current row and previous row in a table. I have a table, which have data like bellow.
    TABLEX
    ================
    Name Date Items
    AAA 01-SEP-09 100
    BBB 02-SEP-09 101
    CCC 03-SEP-09 200
    DDD 04-SEP-09 200
    EEE 05-SEP-09 400
    Now I need to get output like bellow...
    Name Date Items Diff-Items
    AAA 01-SEP-09 100 0
    BBB 02-SEP-09 101 1
    CCC 03-SEP-09 200 99
    DDD 04-SEP-09 200 0
    EEE 05-SEP-09 400 200
    Can some one help me to write a query to get above results?
    Please let me know if you need more information.
    Thanks a lot in advance.
    We are using Oracle10G(10.2.0.1.0).
    Thanks
    Asif

         , nvl (items - lag (items) over (order by dt), 0)like in
    SQL> with test as
      2  (
      3  select 'AAA' name, to_date('01-SEP-09', 'dd-MON-rr') dt,  100 items from dual union all
      4  select 'BBB' name, to_date('02-SEP-09', 'dd-MON-rr') dt,  101 items from dual union all
      5  select 'CCC' name, to_date('03-SEP-09', 'dd-MON-rr') dt,  200 items from dual union all
      6  select 'DDD' name, to_date('04-SEP-09', 'dd-MON-rr') dt,  200 items from dual union all
      7  select 'EEE' name, to_date('05-SEP-09', 'dd-MON-rr') dt,  400 items from dual
      8  )
      9  select name
    10       , dt
    11       , items
    12       , nvl (items - lag (items) over (order by dt), 0)
    13    from test
    14  ;
    NAM DT             ITEMS NVL(ITEMS-LAG(ITEMS)OVER(ORDERBYDT),0)
    AAA 01-SEP-09        100                                      0
    BBB 02-SEP-09        101                                      1
    CCC 03-SEP-09        200                                     99
    DDD 04-SEP-09        200                                      0
    EEE 05-SEP-09        400                                    200
    SQL>

  • Change the current row in an iterator and reflect the change on page

    Hi there,
    I have a jspx with a creation form created as usual draging and droping the data control. In same page, I inserted a commandButton which ActionListener executes a method in a managed bean called validate(). Through such a method what Im trying to do is to fill the form with data from specified entry of the database if certain condition is true. I know it is kinda twisted but unfortunately is the requirement for the page.
    So basically in "validate" method, if the condition I mentioned is reached, I do the following:
    // execute a Rollback (included in Page Definition) in order to cancel the previous auto-invoked "Create".
    FacesContext context = FacesContext.getCurrentInstance();
    Application app = context.getApplication();
    BindingContainer bindings =(BindingContainer)app.getVariableResolver().resolveVariable(context,"bindings");
    OperationBinding opBinding = bindings.getOperationBinding("Rollback");
    opBinding .execute();
    //get the iterator and asociated VO from the binding container
    ValueBinding vb = app.createValueBinding("#{bindings.AccountsVOIterator}");
    DCIteratorBinding dciter = (DCIteratorBinding) vb.getValue(FacesContext.getCurrentInstance());
    ViewObject view = dciter.getViewObject();
    //and set the current row with the specified entry I have mentioned above.
    Object keyValues[] = new Object[2];
    keyValues[0] = "1"; keyValues[1] = "98543";
    Row[] row = view.findByKey(new Key(keyValues),1);
    AccountsVpnVORowImpl client = (AccountsVpnVORowImpl)row[0];
    view.setCurrentRow(client);
    view.executeQuery();
    dciter.setCurrentRowWithKey(client.getKey().toStringFormat(true));
    dciter.executeQuery();
    opBinding = bindings.getOperationBinding("Execute");
    opBinding.execute();
    All this works perfectly when I debbug it but I cannot see the changes in the page(even refreshing browser). I need that when such a condition is met, the creation form turns into a modify-specific entry form, filling all fields with the specific data in order user can modify it, and all in the same page.
    Any clue?
    Thanks so much in advance for your time.

    Hi,
    I could see the problem with call to executeQuery and execute methods at the end of your method which re-sets the current row.
    Once you set the current row you should not call execute or executequery methods. Try removing those calls and also make sure that you have added partialTriggers property on the table is set to commandbutton id and partialSubmit property is set to true on commandButton to refresh the table partially on click of a button
    Sireesha

  • Possible bug: validation errors raise at table row and current row is lost

    Hi everybody,
    I've just implemented a simple test case against the HR schema:
    1. Create Business Components from Tables: choose only Employees. That will generate Employees EO, EmployeesView VO, associations, viewlinks and AppModule with the following hierarchy: EmployeesView1 > EmployeesView2
    2. Create a simple page with an ADF Table based on EmployeesView1.
    3. Surround af:table with af:panelCollection
    4. Add toolbar buttons to the af:panelCollection "toolbar" facet:
    <f:facet name="toolbar">
      <af:toolbar id="t2">
        <af:commandToolbarButton actionListener="#{bindings.CreateInsert.execute}" text="CreateInsert" disabled="#{!bindings.CreateInsert.enabled}" id="ctb1" partialTriggers="t1"/>
        <af:commandToolbarButton actionListener="#{bindings.Delete.execute}" text="Delete" disabled="#{!bindings.Delete.enabled}" id="ctb2" partialTriggers="t1"/>
      </af:toolbar>
    </f:facet>5. Create a af:panelGroupLayout that encloses everything under af:form
    <af:document id="d1" title="Employees">
      <af:messages id="m1"/>
      <af:form id="f1">
        <af:panelGroupLayout id="pgl1" partialTriggers="pc1:ctb1 pc1:ctb2">
    ...6. Delete the LastName field for any row in the table and click anywhere on the next row in the table. This will raise a mandatory field validation error. At this point, the selected row is the one you've just clicked on, but the focus (mouse cursor) is in the LastName field that raised the error.
    7. Fill in the LastName field. Don't click on it; just write something, as the field is already focused.
    8. Click the CreateInsert button
    Result: The current row is still the one you clicked on before, not the newly created row. If you click on this new row to fill in its fields, validation errors raise for every mandatory field.
    I'd appreciate any help on this. I can send you the test case if necessary.
    Thanks in advance,
    Barbara
    Version
    ADF Business Components 11.1.1.56.60
    Java(TM) Platform 1.6.0_18
    Oracle IDE 11.1.1.3.37.56.60

    Hi,
    if you
    1. Select (click) a row to edit last name (don't edit last name though)
    2 Press "CreateInsert"
    Does this then make the new row becoming the current if nor errors are shown ?
    Frank
    Ps.: If so, please send me the test case. My mail address is in my OTN profile. Just zip the workspace and change the ".zip" extension to something like ".unzpme" because the Oracle firewall bounces all mails with zip attachements

  • Get current row and column in JEditorPane

    Hi,
    I have a JEditorPane and I want to show the current row and column according to the caret position
    can anyone please assist ?
    Thanks,
    Dekel

    JEditorPane was designed to display HTML which may not have a great concept of row column once you start adding tables and other fancy stuff. If you only have text data then I would use a JTextArea or JTextPane, they are easier to work with.
    I want to show the current row and column according to the caret positionCheck out this posting:
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=608220

  • I have a dynamic table that calculates the sum of all rows, no issue.  I'm struggling with pulling out a subtotal though.  I would like to have a check box in each row  that flags those rows and gives the sum of their total.  Any help would be greatly app

    I have a dynamic table that calculates the sum of all rows, no issue.  I'm struggling with pulling out a subtotal though.  I would like to have a check box in each row  that flags those rows and gives the sum of their total.  Any help would be greatly appreciated.

    Here's something I threw together rq. The script is in the change event for the checkbox in the table. (Of course, you'll have to modify it to suit the names of your fields.)
    var rows = xfa.resolveNodes("tblAmounts.Row1[*]");
    var subtotal=0;
    for (i=0; i<rows.length; i++) if (rows.item(i).cbAdd.rawValue == 1) subtotal = subtotal + rows.item(i).nfAmount.rawValue;
    nfSubtotal.rawVlaue=subtotal;

  • How to set text and background color of current row in a adf table?

    Hi,
    In jdev 11.1.2.3,
    How to set text fond and background color of current row in a adf table?
    I tried to set Background color in table property, but that is not what i want.
    Thanks.

    Hi,
    We almost had the same requirement, but we just needed to color a specific column.
    Here goes the solution to that, you might do the same for your row highlighting
    Changes are required in jsff and one method to be added in backing bean
    1. JSFF :
    <af:column headerText="Amount"
                     id="c4" width="100"
                     inlineStyle="#{backingBeanScope.BackingBean.cellColor}">2. Backing Bean
    //searchResultTableVO is Table's VO
    public String getCellColor() {
          FacesContext ctx = FacesContext.getCurrentInstance();
          ExpressionFactory ef = ctx.getApplication().getExpressionFactory();
          ValueExpression ve = ef.createValueExpression(ctx.getELContext(), "#{row}", FacesCtrlHierNodeBinding.class);
          FacesCtrlHierNodeBinding node = (FacesCtrlHierNodeBinding)ve.getValue(ctx.getELContext());
          Row row = node.getRow();
        if(row.equals(searchResultTableVO.getCurrentRow())){
    //You can add your inline style for font-style too
          return "background-color:Red;";
             return null;
      }Hope this is helpful :)
    Regards,
    Neha..

  • Calculating 3 row records and remaining records

    Thanks in advance
    When i use following query(1) i am getting exact results for every 3 rows
    when i use query2 i am not getting results for every 3 rows
    1)SELECT     a.*,
    REGR_R2 (average, prof) OVER ( ORDER BY     a
                        ROWS BETWEEN CASE
                                       WHEN MOD (a, 3) = 0
                                       THEN 3
                                       WHEN a = ( SELECT MAX (a)
                                            FROM tableaa
                                       THEN MOD (a, 3)
                                       ELSE 0
                                  END          PRECEDING
                             AND     CURRENT ROW
                        ) AS r_square
    FROM     tableaa a
    --where a <> 3
    ORDER BY a;
    A     BEG     END     PROF     AVERAGE     R_SQUARE
    1     0     0.1     159     159     
    2     0.1     0.2     159     168     
    3     0.2     0.3     179     159     0.25
    4     0.1     0.2     250     300     
    5     0.2     0.3     320     250     
    6     0.3     0.4     250     380     0.164520715073488
    7     0.2     0.3     388     379     
    8     0.3     0.4     379     388     
    9     0.4     0.5     388     400     0.218256852125604
    10     1.5     0.6     499     500     
    11     0.5     0.6     420     448     0.953783619429657
    2) SELECT     a.*,
    REGR_R2 (average, prof) OVER ( ORDER BY     a
                        ROWS BETWEEN CASE
                                       WHEN MOD (a, 3) = 0
                                       THEN 3
                                       WHEN a = ( SELECT MAX (a)
                                            FROM tableaa
                                       THEN MOD (a, 3)
                                       ELSE 0
                                  END          PRECEDING
                             AND     CURRENT ROW
                        ) AS r_square
    FROM     tableaa a
    where a <> 3
    ORDER BY a;
    A     BEG     END     PROF     AVERAGE     R_SQUARE
    1     0     0.1     159     159     
    2     0.1     0.2     159     168     
    4     0.1     0.2     250     300     
    5     0.2     0.3     320     250     
    6     0.3     0.4     250     380     0.20518925851521
    7     0.2     0.3     388     379     
    8     0.3     0.4     379     388     
    9     0.4     0.5     388     400     0.218256852125604
    10     1.5     0.6     499     500     
    11     0.5     0.6     420     448     0.953783619429657
    create table TABLEAA
    A NUMBER,
    BEG NUMBER,
    END NUMBER,
    PROF NUMBER,
    AVERAGE NUMBER
    prompt Loading TABLEAA...
    insert into TABLEAA (A, BEG, END, PROF, AVERAGE)
    values (10, 1.5, .6, 499, 500);
    insert into TABLEAA (A, BEG, END, PROF, AVERAGE)
    values (1, 0, .1, 159, 159);
    insert into TABLEAA (A, BEG, END, PROF, AVERAGE)
    values (2, .1, .2, 159, 168);
    insert into TABLEAA (A, BEG, END, PROF, AVERAGE)
    values (3, .2, .3, 179, 159);
    insert into TABLEAA (A, BEG, END, PROF, AVERAGE)
    values (4, .1, .2, 250, 300);
    insert into TABLEAA (A, BEG, END, PROF, AVERAGE)
    values (5, .2, .3, 320, 250);
    insert into TABLEAA (A, BEG, END, PROF, AVERAGE)
    values (6, .3, .4, 250, 380);
    insert into TABLEAA (A, BEG, END, PROF, AVERAGE)
    values (7, .2, .3, 388, 379);
    insert into TABLEAA (A, BEG, END, PROF, AVERAGE)
    values (8, .3, .4, 379, 388);
    insert into TABLEAA (A, BEG, END, PROF, AVERAGE)
    values (9, .4, .5, 388, 400);
    insert into TABLEAA (A, BEG, END, PROF, AVERAGE)
    values (11, .5, .6, 420, 448);
    commit;

    How about:
    SELECT d.*
    FROM   (SELECT c.*, last_value(r_square ignore nulls) over (order by rn_desc) r_square_val
            FROM   (SELECT a.*,
                           REGR_R2 (average, prof) OVER (ORDER BY rn
                                                         ROWS BETWEEN CASE WHEN MOD (rn, 3) = 0
                                                                                THEN 3
                                                                           WHEN rn_desc = 1
                                                                                THEN  MOD (rn, 3)
                                                                           ELSE  0
                                                                      END  PRECEDING
                                                               AND CURRENT ROW) AS r_square
                    FROM   (select b.*,
                                   row_number() over (order by b.a) rn,
                                   row_number() over (order by b.a desc) rn_desc
                            from   tableaa b
                            where  b.a != 3) a) c) d
    where trunc(r_square_val, 2) = 0.01
    ORDER BY  d.a;

  • LOV switcher and set current Row

    Hi
    I have a LOV switcher attached to one of the columns in the view object.
    It works fine while switching the LOV's in mostly all conditions.
    But its failing for one case.
    We are using checkboxex to select a row , and do a operation in the row.
    To do this, the button on which the operation is performed ...
    1)we have checked which row has the transient value of check box as checked
    2) Set the current row of the iterator to the row that comes from the selected check box index..
    3) Called the operation.
    But as the code go to step two and the current row is set to the required row, all the LOV 's in all the rows start showing the Default LOV which is selected in the LOV switcher, if i do a f5 fr the page, the original values are restored.
    Also if the VO fecth size is 25 , it gives wrong value for 25 rows, if i scroll through the table again it automatically shows the correct value.
    This has been taking a lot of out time to debug the issue.
    I guess its somethng to do with LOV switcher , set current row and the table getting refreshed incorrectly on set current row

    Hi Timo ,
    Thanks fr the reply..
    Jdev 11.1.1.4
    Code for checkbox selection
    DCBindingContainer dcbindings =
    (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    DCIteratorBinding iterator =
    dcbindings.findIteratorBinding(iteratorName);
    Row[] rowSet = iterator.getAllRowsInRange();
    Integer selectCount = 0;
    for (Row row : rowSet) {
    Object selAtt = row.getAttribute(selectAttribName);
    if (selAtt != null && (Boolean)selAtt == true) {
    System.out.println("Row selected");
    selectCount++;
    if (selectCount > 1) {
    System.out.println("More than one row selected!");
    throw new ValidationException("More than one row selected");
    else{
    iterator.setCurrentRowWithKey(row.getKey().toStringFormat(true));
    } else {System.out.println("Row not selected");}
    I actually sorted the issue out
    had to write
    iterator.refresh(Row.REFRESH_CONTAINEES); after iterator.setCurrentRowWithKey(row.getKey().toStringFormat(true));
    But not sure if thts correct ...

  • Pass current row data from table and pass it to a method in AM

    Hi All,
    I have a table with row selection enabled. Also for each row I have a select image which on selection should pass the data from one of the columns of the current row selected to a method in AM.
    Can anybody let me know on "How on selection of the image in any row, can I pass the column data to the method in AM?".
    Thanks,
    Vijay

    Hi,
    the most easiest and straight forward approach is
    - Ckick the "Binding" tab at the bottom of the Visual Editor
    - In the Bindings section click teh green plus icon and choose Generic Bindings | Attribute Value
    - point the iterator selection to the iterator used by the table
    - choose the column's attribute name from the list of attributes
    - Create a method on the ApplicatioNModule IMPL class (should take single argument)
    - expose it as a client interfaces so it shows in the Data Controls panel
    - In the "Binding" tab, create a method binding for this exposed method
    - point the method binding argument to #{bindings.column-attribute-name.inptValue}
    So whenever you need to pass the value on to the AM, you just call the method binding
    OperationBinding oper = (OperationBinding) bindings.get("name of method");
    oper.execute();
    Frank

  • BEx - Display current year and previous year by day on the same row

    Hello experts, need some help/suggestions on how I can accomplish the following please. 
    We have a requirement to show MTD revenue by day for the current year and previous year.  The desired result will have the following columns
    Calendar Day   |     Current MTD Revenue     |     Prev MTD Revenue
    11/01/2009       |      15,131,005                    |        15,138,668
    11/02/2009         |    15,055,345    |                        15,523,762
    However, the result is showing up as follows:
    Calendar Day   |     Current MTD Revenue     |     Prev MTD Revenue
    11/01/2008       | |                                                   15,138,668
    11/02/2008       | |                                                   15,523,762
    11/01/2009       |      15,131,005 |
    11/02/2009       |      15,055,345 |
    The number of rows for Calendar Day varies depending on the date the user selects.  We only want to display the days for the current year with the Previous Year Column on the same row. 
    Can someone please let me know how I can get the results to display on one line for each day? 
    Thanks,
    David

    I have the same issue on my end, and am interested in responses. I searched the forum and found this suggestion in another post; not sure if this solution will help, but it looks like it might. This was a response from poster RadhaN:
    RadhaN  
    Posts: 390
    Registered: 8/27/09
    Forum Points: 876 
       Re: a simple query to show sales versus last year on daily basis/   
    Posted: Sep 21, 2009 9:53 AM    in response to: Shlomi Weiss           Reply 
    HI Shlomi
    Create a virtual characteristic in your infoprovider that can calculate the day from calendar Day. In ZXRSRZZZ while adding code for this virtual characteristic use the function module DATE_COMPUTE_DAY to compute the day for every calendar day.
    For calculating Sales Current year, create a restricted ky figure with Sales as the key figure. Add 0CalDay to this RKF and create a variable for this infoobject(Eg: ZCURYEAR) that will receive input from the user for the range of dates eg: 08/16/2009 - 08/22/2009.
    For Sales Prior year, create another restricted key figure with Sales. Add 0CalDay to this RKF and add a customer exit variable. In the Customer exit code use the ZCURYEAR variable and offset it to prior year in both the upper and lower limits. This should work.
    I hope this helps.
    Thanks.

Maybe you are looking for