Sub-total and Total for a column having checkboxes in WD ABAP ALV

Hello Experts,
I have used ALV in We bdynpro ABAP to display my output. There are 2 columns that are checkboxes in Output. I want a sub-total and total for those two columns. I know tht total and sub-total functionality is available only for numeric fields .
Is there any other indirect way by which i can achieve the same ?

Hi Ragini,
Please refer this thread: [alv total and subtotal|How to display graphs;.
I hope it helps.
Regards
Arjun

Similar Messages

  • Interactive Report Sub-total and total

    Hi friends,
    I have an employee interactive report with group by job name and also showing the salary sub-total for each and every job(group by).
    I have an requirement like to highlight the sub-total for each and every job with a background color so that the user can identify the sub-total with the color, and also whether it is possible to display an overall total @ last in the report with a label named "Total Salary" in which it calculates the overall salary is also to be highlightened with the background color.
    Also is it possible to display a text "Sub-total" besides each and every salary sub-total  of job(group by). Currently if we display a sum for the salary then im getting the total's but with out a text named total.
    Since i can see the highlighted feature in interactive report but im not sure how to apply it for the sub-total and total column.
    I have reproduced the example in apex.oracle.com
    http://apex.oracle.com/pls/apex/f?p=4550:1:0:::::
    In the application 9494 named "test" in page1.
    Thanks in advance.
    Brgds,
    Mini

    Hi, Mini,
    style=background-color:red;
    But that Total region color dint change.The code for style should be in "Form HTML Element Attributes". However, this changes the background color only for the Total value not for the whole row.
    If you want to change for the whole row, you need to change the template that is selected for the region.
    I changed the region template in your application to "Borderless Region" and made the changes to the "Borderless Region" template, it now shows the background color for Total Value.
    <table class="t20Region t20Borderless #REGION_CSS_CLASSES#" id="#REGION_STATIC_ID#" border="0" cellpadding="0" cellspacing="0" summary="" #REGION_ATTRIBUTES#>
    <thead><tr><th class="t20RegionHeader" id="#REGION_STATIC_ID#_header">#TITLE#</th></tr></thead>
    <tbody id="#REGION_STATIC_ID#_body">
    <tr><td class="t20ButtonHolder">#CLOSE##PREVIOUS##NEXT##DELETE##EDIT##CHANGE##CREATE##CREATE2##EXPAND##COPY##HELP#</td></tr>
    <tr><td class="t20RegionBody" style="background-color:orange">#BODY#</td></tr>
    </tbody>
    </table>The below does the trick. :)
    <tr><td class="t20RegionBody" style="background-color:orange">#BODY#</td></tr>Note: I made the changes to "Borderless Template", but you can copy the template to your own and apply this change.
    Regards,
    Natarajan

  • Sub totals and Totals

    I am developing a query using SQVI.
    How do I insert subtotals and totals for certain fields at the end of the query report.
    Thanks
    Sandeep

    hI SANDEEP  .....
    if you  go with  layou mode   then    there will be   3  pops  like   delete  ,  TOOL BAR  , SORT FIELDS ....etc ..
    there is  TOOL BAR   with the following  options   ...
    Background
    Heading
    Normal
    <b>Subtotals</b>
    Key Columns
    Positive
    Negative
    Control Levels
    Background (intensified
    Header (intensified)
    Normal (intensified)
    Sum totals (intensified
    Keys (intensified)
    Positive (intensified)
    Negative (intensified)
    Control lev.(intensifie
    so  that  by selecting the  fields   .....  liek sub total   acrros the  Fiscal  year  can be done  ....  Document wise   sub total  ..... vendor wise   , customer wise  ... like  based  on the fields   selection for sub total  and   total can  be  done ...
    Girish

  • Running Total and In Current Year Columns Source

    Hi all,
    What is the source for Running Total and In Current Year Columns from Absence Detail Screen.
    From Which tables can I get the information on those columns.
    Thanks in Advance

    Hello,
    I am still struck with Running Total Column
    When i fetch running total using this query it works for some of the employees
    SELECT SUM(ABSENCE_hours) from PER_ABSENCE_ATTENDANCES where person_id = <your person id> and absence_attendance_type_id = <your absence type id>
    As there are three different cases here as Days,Hours and No Balance
    I am missing the logic again here when it comes for no balance and days
    Thanks

  • Calculate total and average for same key figure

    Hi Experts,
    I have a requirement where I need to calculate total and average for same key figure no of employees.
    eg:                
    If I enter 03,2009 as Input the reuslt should give from financiual year starting to current month.
         11.2008      12.2008     1.2009     2.2009     3.2009        average
             11          10       12       10        10         10.6
             10         10       11       12        10         10.6
    total         21         20       23       22        20          21.2
    we have only one characteristic in rows... companycode.
    Waiting for your Inputs.
    Regards
    Prasad Nannuri

    no it will work for u
    you have to use variable on 0calmonth or fiscal period depending on what Time characteristic u are using.
    lets say that variable is zcalmonth
    it is based on 0calmonth for e.g.
    now u restrict keyfigure with this variable zcalmonth with time char. = 0CALMONTH
    copy and paste the restricted keyfigure
    now set offset for variable in  variable selection screen dialog box = -1
    repeat this until u want
    make this variable mandatory
    now at query execution user will select any value for month/year
    and u will see all 5 months in result set
    now there can be maximum 12 months in a year, so u end up creating only 12 restricted keyfigures.
    use YEAR in restricted keyfigure too, and restrict it with YEAR VARIABLE processing by CUSTOMER EXIT = CURRENT YEAR
    in this case it will automatically removes any additional values...
    for e.e.g
    YEAR = 2008 only
    User entered 6/2008
    so lets say ur financial year starts in  april 2007 and ends in april 2008
    so u expect to see
    4/08
    5/08
    6/08
    but u created 12 restricted keyfigures , so it will show upto
    4,5,6 months only

  • Search Segregation - do I have to use a sub-domain and pay for a separate IP address?

    I've got a site that must keep the same domain but has two separate types of visitors (think customers and vendors) is creating a sub-domain and paying for a separate IP address the only way to completely segregate the search results (without going to private login features)?
    I really need to segregate the web content as both customers and vendors have similar questions but the content on their pages aren't helpful to each other. Currently my search results are heavy on Vendor content even when a it is a customer search topic.

    An iCloud email account is accessed with the iPhone's Mail app as an IMAP account. Contacts are synced with the Contacts app on your iPhone, calendar events are synced with the Calendar app, and notes are synced with the Notes app, etc.
    On your desktop, you can add a bookmark with your browser and/or add a webclip to your Desktop for the website if you plan on accessing the account via webmail, or the email account can be created/accessed as an IMAP account with an email client on your computer.

  • Sub-totals and Totals calculations....?

    How to Calculate the Sub-totals and Grand totals in ABAP Programs.

    Hi Bhaskar,
    In my opinion this can be acheived in two ways:
    1. Using ALV GRID DISPLAY
    2. Using AT NEW  , ON CHANGE OF  , etc events.
    1. In the ALV field catalogue u create entries for all the fileds to b
    displayed in the output list.
    Here, we need to put DO_SUM = 'X' .
    eg
      ****************fieldcatalog*********************
    data:anytab type slis_t_fieldcat_alv with header line.
    **************pgm name**********************
    data:anypgnm type sy-repid.
    **************events*************************
    anytab-fieldname   = 'MATNR'.
      anytab-seltext_m   = 'Material Number'.
      anytab-col_pos     = 0.
      anytab-outputlen   = 20.
      anytab-emphasize   = 'X'.
      anytab-do_sum = 'X' .                  <----
    here it is.
      append anytab to anytab .
      clear  anytab .
    Now wen u call the fm REUSE_ALV_GRID_DISPLAY , plz pass anytab ie fieldcatalog  and  the tabel with records to  b displayed .
    this would  sum the fields at the end.
    2.  Alternately ....for SUb-totals ;
       Sort itab in an ascending manner.
    Data : wa_itab    like line of itab,
              wa_subtotal type i.
    " fieldname1 in itab is the key field
    " fieldname2 is the value field
    LOOP at itab into wa_itab .
      wa_subtotal = wa-subtotal  + itab-<fieldname2>.
      AT END OF <fieldname1> .
          " your programming logic for subtotal
           Write :/ wa_itab-fieldname1 , wa_subtotal.
           Clear  wa_subtotal.
       ENDAT.
       " write :/  ....if u need to write any lofgic values ....
    ENDLOOP .
    Note : plz sc if a field in itab that is left of fieldname1 changes
              the AT END OF event is triggered.
             Therefoe , see that  pur key fields towards left in itab.
    FYI : u can try ON CHANGE OF....ENDON....
                          AT NEW .....ENDAT
                           AT LAST....ENDAT
                           AT FIRST ......ENDAT  events for ur own understanding
    i hope this helps u.
    Regards
    panakj

  • Write again sub-header and header for every start of new page in report

    Hello experts,
    In my report, I declared my line-count to be 0. I don't know if this is correct
    but what I want to do is that for every new page, I want to write again my
    sub-header and header. How do I do this? Thanks again guys!

    Hi again,
    1. CALL METHOD top->top_of_page
    What does it do ?
    Probably it prints the headings and sub-headings.
    2. Now, again in start-of-selection,
       we have written,
    CALL METHOD main->display_subheader.
    CALL METHOD main->display_header.
    , so it becomes twice.
    3. Ideally it could be like this :
    <b>TOP-OF-PAGE.</b>
    <b>CALL METHOD main->display_subheader.
    CALL METHOD main->display_header.</b>
    Remove
    CALL METHOD main->display_subheader.
    CALL METHOD main->display_header.
    from start-of-selection.
    regards,
    amit m.

  • Total and Subtotal for set_table_for_first_display

    Hello,
    I am displaying data in ALV by using set_table_for_first_display , i want to do_sum  for
    10-15 columns starting from the column index 11.. and i have also passed the value in internal table of type LVC_T_SORT and in the fieldcatlog this fields are checked for DO_SUM but sum is not coming in the final output even summation button is disabled and subtotal is also getting reflected.
    Is it i need to do extra to do this when i am displaying data by using the OOPS methos?
    Please sugggest what could be the reason..
    Thanks
    Prince

    Hi,
    Try the below code.
    TABLES: mara.
    SELECT-OPTIONS: s_matnr FOR mara-matnr.
    types: begin of ty_marc,
             matnr type marc-matnr,
             werks type marc-werks,
             count type i,
           end of ty_marc.
    data: it_marc type standard table of ty_marc with header line.
    START-OF-SELECTION.
      SELECT matnr werks FROM marc INTO TABLE it_marc WHERE matnr IN s_matnr and werks in ('0888', '0811').
      loop at it_marc.
        it_marc-count = 1.
        modify it_marc transporting count.
      endloop.
    "* Definition for Object Oriented ALV
      DATA: gr_table      TYPE REF TO cl_salv_table.
      DATA: gr_sorts      TYPE REF TO cl_salv_sorts.
      DATA: gr_agg        TYPE REF TO cl_salv_aggregations.
      DATA: gr_agg2       TYPE REF TO cl_salv_aggregation.
      DATA: gr_display    TYPE REF TO cl_salv_display_settings.
      DATA: gr_layout     TYPE REF TO cl_salv_layout.
      DATA: ls_key        TYPE salv_s_layout_key.
    "* Display ALV as a Grid
      TRY.
          cl_salv_table=>factory( IMPORTING r_salv_table = gr_table
                                  CHANGING  t_table      = it_marc[] ).
        CATCH cx_salv_msg.
      ENDTRY.
        TRY.
            gr_agg = gr_table->get_aggregations( ).
            CALL METHOD gr_agg->add_aggregation
              EXPORTING
                columnname  = 'COUNT'
                aggregation = if_salv_c_aggregation=>total
              RECEIVING
                value       = gr_agg2.
          CATCH cx_salv_data_error .
          CATCH cx_salv_not_found .
          CATCH cx_salv_existing .
        ENDTRY.
    "* Set up Sorts
        TRY.
            gr_sorts = gr_table->get_sorts( ).
            CALL METHOD gr_sorts->add_sort
              EXPORTING
                columnname = 'MATNR'
                position   = 1
                sequence   = if_salv_c_sort=>sort_up
                subtotal   = if_salv_c_bool_sap=>true
                group      = if_salv_c_sort=>group_none
                obligatory = if_salv_c_bool_sap=>false.
          CATCH cx_salv_data_error .
          CATCH cx_salv_not_found .
          CATCH cx_salv_existing .
        ENDTRY.
    "* Add layout variants in report
        TRY.
          gr_layout = gr_table->get_layout( ).
    "*... set the Layout Key
          ls_key-report = sy-repid.
          gr_layout->set_key( ls_key ).
    "*... set usage of default Layouts
          gr_layout->set_default( abap_true ).
    "*... set Layout save restriction
          gr_layout->set_save_restriction( if_salv_c_layout=>restrict_none ).
        ENDTRY.
        TRY.
    "* Display ALV
          gr_table->display( ).
        ENDTRY.
    Hope it helps.
    Thanks,
    Balaji

  • Caculating page wise sub totals and totals

    Friends,
    I am working on an ADOBE form,  where i need to calculate subtotals and grand totals for the invoice lines displayed.
    I achieved the functionality in the smartforms by defining a different window under the main window(this contains line amounts). For the new window where the subtotal is expected to print i triggerred the event 'Before the end of main window' to print the totals before the lines flow to the next page by auto page break in the main window.
    I tried in the forms putting different content area(other than the main content area where table lines are printed) for the subtotals in the layout designer and manipulated using all the pagination options avialable in the table properties, but in vain. 
    What exatly is the equivalent for the event 'Before the end of main window' as that of smart forms.
    Any inputs on this?
    regards
    Nalinikanth.

    Hi Nalinikanth,
    assumed you have a table created with subforms like
    MyTable
    - Header
      (text elements)
    - Data
      (repeating subform with line elements)
    you can create a line with subtotal as following:
    1. Define a new line below "MyTable" for the subtotals with name e.g. "Subtotals" and insert elements (similar to the ones in "Data").
    2. In subform "Data": palette Object -> Pagination -> Overflow Trailer: "Subtotals"
    3. In Hierarchy palette, right-click on "Subtotals" -> Insert Script Object
    4. name this script object "tableCalcs" and insert following code
    *   Table Calculation Functions
    *     To invoke these functions:
    *   syntax:     scriptObjectSOM.obj.functionName(sFieldName, [startPage], [endPage]);
    *   example:     tableCalcs.Sum("Field1", 2, 3);
    *   notes:           
    *                    -The SOM expression of the Script Object may vary upon its position in the Hierarchy.
    *                    -The start and end page arguments are 0-based numbers or a reference to an XFA object.
    DO NOT MODIFY THE CODE BEYOND THIS POINT - 705.20051114114126.253659.250577 - tableCalcs.xfo
    var obj = new CalcObject();
    function CalcObject()
         this.Sum = _doSum;
         this.Average = _doAverage;
         this.Count = _doCount;
    *     Calculate the sum of all fields with the same name.
    *      NUMBER Sum(STRING sFieldName, [NUMBER pageNum])
    *      NUMBER Sum(STRING sFieldName, [OBJECT xfaObject])
    *      NUMBER Sum(STRING sFieldName, [NUMBER startPage], [NUMBER endPage])
    *      NUMBER Sum(STRING sFieldName, [OBJECT xfaObject], [OBJECT xfaObject])
    *     param1:     STRING; Name of field to calculate sum of
    *     param2:     NUMBER; Start page for calculation
    *     param2:     OBJECT; XFA object on the page calculation will start on
    *     param3:     NUMBER; End page for calculation
    *     param3:     OBJECT; XFA object on the page calculation will end on
    *     return: NUMBER; Sum of all fields
    function _doSum(fieldName)
         var fieldSum = null;
         var startPage = 0;
         var endPage = 0;
         var lengthOfDecimal = 0;
         if (arguments.length == 2) {
              startPage = _GetPageNum(arguments[1]);
              endPage = startPage;
         } else if (arguments.length == 3){
              startPage = _GetPageNum(arguments[1]);
              endPage = _GetPageNum(arguments[2]);
         } else {
              startPage = 0;
              endPage = xfa.layout.pageCount() - 1;
         if ((startPage < 0) || (endPage < 0) || (startPage > endPage))
              throw new PageNumberException(startPage, endPage);
         var curPage = startPage;
         while (curPage <= endPage) {
              // Get the field containers on the current page
              var oFields = xfa.layout.pageContent(curPage, "field");
              var fieldCount = oFields.length;
              // Continue if fields were found on the page
              if (fieldCount > 0) {
                   var i = 0;
                   for (i=0; i < fieldCount; i++) {
                        if (oFields.item(i).name == fieldName) {
                             //only count non-empty/numeric fields
                             var fieldVal = _GetFieldVal(oFields.item(i));
                             if (fieldVal != null) {                         
                                  fieldSum += fieldVal;
                             if (_GetLengthOfField(oFields.item(i)) > lengthOfDecimal) {
                                  lengthOfDecimal = _GetLengthOfField(oFields.item(i));
              curPage++;
         if (fieldSum == null)
              throw new FieldNotFoundException(fieldName);
         if(lengthOfDecimal > 0) {
              return fieldSum.toFixed(lengthOfDecimal);
         return fieldSum;
    *     Calculate the average of all fields with the same name.
    *      NUMBER Average(STRING sFieldName, [NUMBER pageNum])
    *      NUMBER Average(STRING sFieldName, [OBJECT xfaObject])
    *      NUMBER Average(STRING sFieldName, [NUMBER startPage], [NUMBER endPage])
    *      NUMBER Average(STRING sFieldName, [OBJECT xfaObject], [OBJECT xfaObject])
    *     param1:     STRING; Name of field to calculate average of
    *     param2:     NUMBER; Start page for calculation
    *     param2:     OBJECT; XFA object on the page calculation will start on
    *     param3:     NUMBER; End page for calculation
    *     param3:     OBJECT; XFA object on the page calculation will end on
    *     return: NUMBER; Average of all fields
    function _doAverage(fieldName)
         var fieldCount = null;
         var fieldSum = null;
         var startPage = 0;
         var endPage = 0;
         var lengthOfDecimal = 0;
         if (arguments.length == 2) {
              startPage = _GetPageNum(arguments[1]);
              endPage = startPage;
         } else if (arguments.length == 3){
              startPage = _GetPageNum(arguments[1]);
              endPage = _GetPageNum(arguments[2]);
         } else {
              startPage = 0;
              endPage = xfa.layout.pageCount() - 1;
         if ((startPage < 0) || (endPage < 0) || (startPage > endPage))
              throw new PageNumberException(startPage, endPage);
         var curPage = startPage;
         while (curPage <= endPage) {
              // Get the field containers on the current page
              var oFields = xfa.layout.pageContent(curPage, "field");
              var allFields = oFields.length;
              // Continue if fields were found on the page
              if (allFields > 0) {
                   var i = 0;
                   for (i=0; i < allFields; i++) {
                        if (oFields.item(i).name == fieldName) {
                             //only count non-empty/numeric fields
                             var fieldVal = _GetFieldVal(oFields.item(i));
                             if (fieldVal != null) {
                                  fieldCount ++;
                                  fieldSum += fieldVal;
                             if (_GetLengthOfField(oFields.item(i)) > lengthOfDecimal) {
                                  lengthOfDecimal = _GetLengthOfField(oFields.item(i));
              curPage++;
         if (fieldCount == null)
              throw new FieldNotFoundException(fieldName);
         if (fieldCount != null && fieldSum != null && fieldCount > 0) {
              var average = fieldSum / fieldCount;
              if(lengthOfDecimal > 0) {
                   return average.toFixed(lengthOfDecimal);
              return average;
         else {
              return null;
    *     Calculate the number of fields with the same name.
    *      NUMBER Count(STRING sFieldName, [NUMBER pageNum])
    *      NUMBER Count(STRING sFieldName, [OBJECT xfaObject])
    *      NUMBER Count(STRING sFieldName, [NUMBER startPage], [NUMBER endPage])
    *      NUMBER Count(STRING sFieldName, [OBJECT xfaObject], [OBJECT xfaObject])
    *     param1:     STRING; Name of field to calculate number of
    *     param2:     NUMBER; Start page for calculation
    *     param2:     OBJECT; XFA object on the page calculation will start on
    *     param3:     NUMBER; End page for calculation
    *     param3:     OBJECT; XFA object on the page calculation will end on
    *     return: NUMBER; Number of fields found
    function _doCount(fieldName)
         var fieldCount = null;
         var startPage = 0;
         var endPage = 0;
         if (arguments.length == 2) {
              startPage = _GetPageNum(arguments[1]);
              endPage = startPage;
         } else if (arguments.length == 3){
              startPage = _GetPageNum(arguments[1]);
              endPage = _GetPageNum(arguments[2]);
         } else {
              startPage = 0;
              endPage = xfa.layout.pageCount() - 1;
         if ((startPage < 0) || (endPage < 0) || (startPage > endPage))
              throw new PageNumberException(startPage, endPage);
         var curPage = startPage;
         while (curPage <= endPage) {
              // Get the field containers on the current page
              var oFields = xfa.layout.pageContent(curPage, "field");
              var allFields = oFields.length;
              // Continue if fields were found on the page
              if (allFields > 0) {
                   var i = 0;
                   for (i=0; i < allFields; i++) {
                        if (oFields.item(i).name == fieldName) {
                             //only count non-empty/numeric fields
                             var fieldVal = _GetFieldVal(oFields.item(i));
                             if (fieldVal != null) {
                                  fieldCount ++;
              curPage++;
         if (fieldCount == null)
              throw new FieldNotFoundException(fieldName);
         return fieldCount;
    function _GetFieldVal(obj)
         var fieldVal = obj.rawValue;
         if (typeof fieldVal != "number") {                         
              if (typeof fieldVal == "string" && fieldVal.length > 0) {
                   fieldVal = parseFloat(fieldVal);
                   if (isNaN(fieldVal))
                        fieldVal = null;
              } else {
                   fieldVal = null;
         return fieldVal;
    function _GetPageNum(val)
         var pageNum = -1;
         if (typeof val == "number") {                         
              pageNum = val;
         else if (typeof val == "object") {
              if (val != null) {               
                   pageNum = xfa.layout.page(val) - 1
         return pageNum;
    function _GetLengthOfField(obj)
         var fieldVal = obj.rawValue;
         if (fieldVal != null) {
              if (typeof fieldVal == "number") {
               fieldVal = new String(fieldVal);
              var index = fieldVal.indexOf(".");
              if (index > -1) {
                   return fieldVal.length - index - 1;
         return 0;
    function getExceptionString() { return this.message; }
    function FieldNotFoundException(fieldName)
         this.message = "Calculation failed: No non-empty fields found called '" + fieldName + "'.";
         this.name = "FieldNotFoundException";
         this.toString = getExceptionString;
    function PageNumberException(startPage, endPage)
         this.message = "Calculation failed: Incorrect page references (start page = " + startPage + ", end page = " + endPage + ").";
         this.name = "PageNumberException";
         this.toString = getExceptionString;
    // END OF DO NOT MODIFY     
    5. In the subtotal fields, add script for event "calculate":
    this.rawValue = this.parent.variables.tableCalcs.obj.Sum("AMOUNT", 0, this);
    where "AMOUNT" is the name of the referenced field.
    HTH & best regards,
    Carlo

  • Running total and calc between two column (subtraction)

    Hi Experts!,
    I have a simple requirement but getting me frustrated :( I need to calculate stock on a series of transaction
    this is my order table:
    OrderNo | Item | Delivery | OrderQty
    A-101 | G001 | 20110721 | 200
    A-104 | G001 | 20110722 | 300
    A-102 | GA02 | 20110721 | 210
    and my stock table :
    Item | stockQty
    G001 | 300
    GA02 | 0
    What i want to accomplish is something like this:
    OrderNo | Item | Delivery | OrderQty | StockOut
    A-101 | G001 |20110721 | 200 | 200
    A-104 | G001 |20110722 | 300 | 100
    A-102 | GA02 |20110721 | 210 | 0
    i believe there is must be a way to accomplish this, without using to create extra dummy table to store
    qty of Stock out (stock-orderqty),
    waiting for respons,
    Thanks!

    Try this
    with order1
    as
    select 'A-101' orderno, 'G001' item, 20110721 delivery, 200 orderqty from dual union all
    select 'A-104', 'G001', 20110722, 300 from dual union all
    select 'A-105', 'G001', 20110723, 250 from dual union all
    select 'A-102', 'GA02', 20110721, 210 from dual union all
    select 'A-103', 'GA02', 20110721, 300 from dual
    ), stock
    as
    select 'G001' item, 600 stockqty from dual union all
    select 'GA02', 500 from dual
    select orderno, item, delivery, orderqty, case when qty <= stockqty then orderqty else stockqty - qty1 end stockout
      from (
             select orderno, item, delivery, orderqty, qty, nvl(lag(qty) over(partition by item order by orderno), 0) qty1, stockqty
               from (
                      select orderno, o.item, delivery, orderqty, sum(orderqty) over(partition by o.item order by orderno) qty, stockqty
                        from order1 o
                        join stock s
                          on o.item = s.item
           )Note: Tables defined in the WITH caluse are sample table to show you how the SQL works. You can just use the SELECT statement with your original table.

  • Title and description for lookup column

    Hopefully this can be simple.  I am working on development in SharePoint 2010 but I do NOT think that it is specific to 2013 or 2010, I am migrating to 2013 in a month or so (hopefully!)
    Requirement:
    Display lookup list for Server Name (Title) and Server Description (Description)
    Problem:
    I have a custom list with 2 columns, title and description, both text fields.  I am using that list as a lookup to my other custom list.
    The graphic below has 2 windows squished into it.  The middle window is the list pulling the data from, the lookup list.
    The graphic to the right is the issue that I am running into.  I create the column and hopefully I can use the lookup column with the title column AND THEN the additional fields for the Description!  It DOES appear, but AFTER I fill out the form. 
    The form is on the left part of the graphic below.
    I see the server names or "Title" but I can't even "hover" over it and see the description!  I don't know how to present the description lookup in the form when I do "new item."  Is this something that 2010 / 2013
    can do and OOTB or do I need designer? I don't code so I can't use VS.
    Thank you!
    Matt

    Thank you, I created a calculated column, using Microsoft's recommendations below, and Scott's!
    Calculated Field Formulas -
    http://msdn.microsoft.com/en-us/library/bb862071.aspx
    The result shows below.  the 3rd column is the Server and Description, with the calculated column, "merging" the two text into one, with a space and a dash in the middle to separate them.  The list is below and the "look up".  The black section
    is my new form or add new item, where I would select multiple servers based on their server name and their description.

  • Substr and instr for long column

    Plesae need support ,how can use instr and substr function for column with long datatype
    select substr(rec,1,(instr(rec,'?',1))) from F_DE_O_HISTORY_QUEUE_PRE_TST2
    rec column is long,When execute this select message displayed as ORA-00932: inconsistent datatypes: expected NUMBER got LONG

    Try to create a global temporary table and work on this table using DBMS_LOB.INSTR and DBMS_LOB.SUBSTR:
    SQL> desc t;
    Name                                      Null?    Type
    X                                                  NUMBER(38)
    Y                                                  LONG
    SQL> create global temporary table tmp on commit preserve rows as select x, to_lob(y) as y from t ;
    Table created.
    SQL> desc tmp;
    Name                                      Null?    Type
    X                                                  NUMBER(38)
    Y                                                  CLOBEdited by: P. Forstmann on 19 janv. 2010 12:42

  • Grand total and total in all page

    page 1
    colum1 | cloum2
    4 | 55
    1 | 6
    in Footer page1
    5 | 61
    page 2
    colum1 | cloum2
    2 | 3
    1 | 6
    in Footer page2
    3 | 9
    --------- i want
    in Footer page2
    8 | 70
    plez help me
    Message was edited by: azmi
    user490620

    What do you want exactly?
    Your subject says other thing then your actual question.
    Any how it snot difficult.
    Put summery Columns calculating the SUM of both fields (reset at report)
    & Set there property "print object on" to "last page".
    Hope it 'll work.
    Capri...

  • Get min and max for a column from table with 24 million rows.

    What is the best way to re-write the following query in a procedure for the table which has around 24 million rows?
    SELECT MIN(ft_src_ref_id), MAX(ft_src_ref_id )
    INTO gn_Min_ID, gn_Max_ID
    from UI_PURGE_FT;
    Thanks
    Edited by: tcode on Jun 21, 2012 12:31 PM

    Which of the following plan is better, can you please breifly explain?
    Also I need to gather statics to know recursive calls , db block gets ,consistent gets etc. etc. how can I get that?
    Thanks
    1.
    Execution Plan
    Plan hash value: 3702745568
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 1 | 6 | 13991 (2)| 00:02:48 |
    | 1 | SORT AGGREGATE | | 1 | 6 | | |
    | 2 | INDEX FAST FULL SCAN | UI_PURGE_FT_PK | 23M| 136M| 13991 (2)| 00:02:48 |
    2.
    Execution Plan
    Plan hash value: 1974183109
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 1 | | 2 (0)| 00:00:01 |
    | 1 | SORT AGGREGATE | | 1 | 6 | | |
    | 2 | INDEX FULL SCAN (MIN/MAX)| UI_PURGE_FT_PK | 23M| 136M| 2 (0)| 00:00:01 |
    | 3 | SORT AGGREGATE | | 1 | 6 | | |
    | 4 | INDEX FULL SCAN (MIN/MAX)| UI_PURGE_FT_PK | 23M| 136M| 2 (0)| 00:00:01 |
    | 5 | FAST DUAL | | 1 | | 2 (0)| 00:00:01 |
    ---------------------------------------------------------------------------------------------

Maybe you are looking for

  • Calculation of  tax via tax code

    Dears, There are some concepts about the pricing in PO that I never got it clear. I really appriciate it if someone can help me. 1. What is the base amount for calculate the tax via tax code? In the invoice verification there often is a tax code in w

  • Very simple EJB 3.0 MDB but I get NullPointerException

    I tried to create a very simple EJB 3.0 Message Driven Bean in JDeveloper 10.1.3.2 as follows: Message Driven Bean Class: import javax.ejb.MessageDriven; import javax.jms.Message; import javax.jms.MessageListener; @MessageDriven(mappedName="MDBQueue"

  • Writing data from Java to Excel

    Hi, I am trying to writhe data from Java to an Excel Sheet by using JACOB. This is my code : import java.util.*; import java.io.*; //import cost.util.*; import com.jacob.com.*; import com.jacob.activeX.*; class XLStock      public static void main(St

  • Duplicate invoices check

    hi all i have set up the necessary checks to catch duplicate invoices under path MM-LIV- incoming invoice-set check for duplicate invoices. and in vendor master i flagged the "chk double inv" and in PO ticked "GR-Bsd IV". but the duplicate check does

  • 3D content for iTunes and Apple TV!

    Is apple any closer to supplying 3D content to Apple TV owners and iTunes users? If not, then why not! Most of the forums that came up when I searched it were from 2011, now in the past two years 3D technology has changed as well as the amount of TV