How to group data

I want to display the total number of employees and, of that total, the number of employees hired in 1995,1996,1997 and 1998. Create appropriate column headingslike shown below(is it possible?)
[b]No.ofemployees 1995 1996 1997
20 3 5 6
employee table structure
EMPLOYEE_ID NOT NULL NUMBER(6)
FIRST_NAME VARCHAR2(20)
LAST_NAME NOT NULL VARCHAR2(25)
EMAIL NOT NULL VARCHAR2(25)
PHONE_NUMBER VARCHAR2(20)
HIRE_DATE NOT NULL DATE
JOB_ID NOT NULL VARCHAR2(10)
SALARY NUMBER(8,2)
COMMISSION_PCT NUMBER(2,2)
MANAGER_ID NUMBER(6)
DEPARTMENT_ID NUMBER(4)
No.ofemployees 1995 1996 1997
20 3 5 6

select count(*),
  count(decode(extract(year from hiredate),1980,1)) "1980",
  count(decode(extract(year from hiredate),1981,1)) "1981",
  count(decode(extract(year from hiredate),1982,1)) "1982",
  count(decode(extract(year from hiredate),1987,1)) "1987"
from emp;
  COUNT(*)       1980       1981       1982       1987
        14          1         10          1          2

Similar Messages

  • Help on how to group data in Answers

    Hi
    I need to group data on the number of times it occurs.
    Below is the source data:
    Table:
    Order No; Product
    1 A
    2 A
    3 A
    4 B
    5 B
    I need to show the above data in the follwoing way:
    Product 1 Occurance <2 Occurance <3 Occurance
    A 0 0 3
    B 0 2 0
    Could you please advise on how best to do this?
    Thanks
    A

    I've created a count column in the logical layer and have tried a count in the presentation services. However I am unable to display the results they way I want them.
    I want to show the number of occurrences under the specific heading, example below
    Product Occ 1 Occ 2 Occ 3
    A 0 0 3
    where do you recommend creating the count and how can I show the count under the specific heading?

  • How to group data and assign cell names using Excel templates

    Hi all,
    reading the article "Real Excel Templates 1.5" on the Tim Dexter's Blog, I found that I need hierarchical data for Excel templates. So only in this way I can group my data.
    My hierarchy is composed by 3 levels:
    lev 1 DESTINATION: is the higher level that groups SERVICES and COUNTRY
    lev 2 SERVICES: is the level that groups the countries
    lev 3 COUNTRY: is the lowest level with the COUNTRY, CALLS and CALLS_MINUTES details
    An example of my hierarchy is this:
    lev 1 INTERNATIONAL
    lev 2 INTERNATIONAL FIXED
    lev 3 Albania 90 438,15
    lev 3 Armenia 1 16,95
    lev 2 INTERNATIONAL MOBILE
    lev 3 Albania Mobile 161 603,35
    lev 3 Australia Mobile 6 34,38
    lev 1 NATIONAL
    lev 2 HELLAS LOCAL
    lev 3 Hellas Local 186,369 707940,6
    lev 2 HELLAS MOBILE
    lev 3 Hellas Mobile Cosmote 31,33 43856,97
    lev 3 Hellas Mobile Q-Telecom 2,398 4343,78
    lev 2 HELLAS NATIONAL
    lev 3 Hellas Long Distance 649 1499,55
    lev 1 INTERNET
    lev 2 INTERNET CALLS
    lev 3 Cosmoline @Free 79 2871,3
    So, my data template is the following (with exactly the hierarchy I want for my data):
    <dataTemplate name="emp" description="destinations" dataSourceRef="GINO_DB">
         <dataQuery>
              <sqlStatement name="Q1">
                   <![CDATA[SELECT 1 TOTAL_CALLS, 2 TOTAL_CALLS_MIN from dual ]]>
              </sqlStatement>
              <sqlStatement name="Q2">
                   <![CDATA[SELECT dest.ID_DESTINATION, dest.DESC_DEST from ale.AAA_DESTINATION dest order by dest.ID_DESTINATION ]]>
              </sqlStatement>
              <sqlStatement name="Q3">
                   <![CDATA[SELECT ser.ID_SERVICE,
    ser.ID_DEST,
    ser.DESC_SERVICE,
    count.ID_COUNTRY,
    count.ID_SERV,
    count.COUNTRY,
    count.CALLS,
    count.CALLS_MIN
    from ale.AAA_SERVICE ser, ale.AAA_COUNTRY count
    where ser.ID_SERVICE= count.ID_SERV
    and ID_DEST = :ID_DESTINATION
    order by ser.ID_SERVICE ]]>
              </sqlStatement>
         </dataQuery>
         <dataStructure>
              <group name="G_TOT" source="Q1">
                   <element name="TOTAL_CALLS" value="G_COUNTRY.CALLS" function="SUM()"/>
                   <element name="TOTAL_CALLS_MIN" value="G_COUNTRY.CALLS_MIN" function="SUM()"/>
                   <group name="G_DEST" source="Q2">
                        <element name="DESC_DEST" value="DESC_DEST"/>
                        <element name="DEST_CALLS_SUBTOTAL" value="G_COUNTRY.CALLS" function="SUM()"/>
                        <element name="DEST_CALLS_MIN_SUBTOTAL" value="G_COUNTRY.CALLS_MIN" function="SUM()"/>
                        <group name="G_SERV" source="Q3">
                             <element name="DESC_SERVICE" value="DESC_SERVICE"/>
                             <element name="SERV_CALLS_SUBTOTAL" value="G_COUNTRY.CALLS" function="SUM()"/>
                             <element name="SERV_CALLS_MIN_SUBTOTAL" value="G_COUNTRY.CALLS_MIN" function="SUM()"/>
                             <group name="G_COUNTRY" source="Q3">
                                  <element name="COUNTRY" value="COUNTRY"/>
                                  <element name="CALLS" value="CALLS"/>
                                  <element name="CALLS_MIN" value="CALLS_MIN"/>
                             </group>
                        </group>
                   </group>
              </group>
         </dataStructure>
    </dataTemplate>
    Not considering the CALLS and CALLS_MIN details (I focused only on the COUNTRY which is as the same level), with this data template, making tests on my excel template, I noticed that I can group ONLY two nested levels using the format XDO_GROUP_?group_name?
    XDO_GROUP_?G_DEST?
    XDO_GROUP_?G_SERV?
    or
    XDO_GROUP_?G_DEST?
    XDO_GROUP_?G_COUNTRY?
    or
    XDO_GROUP_?G_SERV?
    XDO_GROUP_?G_COUNTRY
    If I try to group all the three level together in this order
    XDO_GROUP_?G_DEST?
    XDO_GROUP_?G_SERV?
    XDO_GROUP_?G_COUNTRY
    I don't have the output I would like to have.....
    Practically, in my excel I have 3 rows with the following labels
    DESTINATION (called XDO_?DESC_DEST? - =Sheet1!$A$3
    SERVICE (called XDO_?DESC_SERVICE? - =Sheet1!$A$4
    COUNTRY (called XDO_?COUNTRY? - =Sheet1!$A$5)
    where
    XDO_GROUP_?G_DEST? (=Sheet1!$A$3:$B$5)
    XDO_GROUP_?G_SERV? (=Sheet1!$A$4:$B$5)
    XDO_GROUP_?G_COUNTRY     (=Sheet1!$A$5:$B$5)
    I noticed that if I don't use the last one (XDO_GROUP_?G_COUNTRY), my output is correct even if I don't have more than one country for each service....As soon as I put XDO_GROUP_?G_COUNTRY....I loose all the 2nd level and the most of times the 3rd level too....
    So...I think that the problem is how I choose the excel cells when I assign the XDO_GROUP_?group_name?
    Anybody had made some tests, or can help me ???? I'm becoming crazy.....
    Any help will be appreciated
    Thanks in advance
    Alex

    But how can I use tags XDO_GROUP_?? to group data correctly using hierarchial xml, I don't want to use flat XML.
    Yep, I using Template Builder in Excel to run reports localy, and output is wrong
    It's seems that groups couldn't define the level of nesting, I think...
    How can I write it in XDO_METADATA sheet?
    Though I have hierarchial XML and groups should define nesting level correctly.
    I have no clue.....

  • How to group data from two tables ?

    Hello,
    I have two tables and i want to group data from them but two table not linked.
    Table TEXT_IN : ID_IN (primary_key), DATE_IN
    Table TEXT_OUT : ID_OUT(primary_key),DATE_OUT
    Example :
    Result :Group Date and Order by IN,OUT
    And It seems a bit
    confusing because we do not link
    .You can give me solutions.
    Thank you.

    SELECT MAX(CASE WHEN Rn = 1 THEN [IN] END) AS [IN1],
    MAX(CASE WHEN Rn = 1 THEN [OUT] END) AS [OUT1],
    MAX(CASE WHEN Rn = 2 THEN [IN] END) AS [IN2],
    MAX(CASE WHEN Rn = 2 THEN [OUT] END) AS [OUT2],
    MAX(CASE WHEN Rn = 3 THEN [IN] END) AS [IN3],
    MAX(CASE WHEN Rn = 3 THEN [OUT] END) AS [OUT3],
    MAX(CASE WHEN Rn = 4 THEN [IN] END) AS [IN4],
    MAX(CASE WHEN Rn = 4 THEN [OUT] END) AS [OUT4],
    MAX(CASE WHEN Rn = 5 THEN [IN] END) AS [IN5],
    MAX(CASE WHEN Rn = 5 THEN [OUT] END) AS [OUT5],
    FROM
    SELECT COALESCE(m.DATE_IN,n.DATE_IN) AS DATE_IN,
    COALESCE(m.Seq,n.Seq) AS Seq,
    ID_IN AS [IN],
    ID_OUT AS [OUT],
    ROW_NUMBER() OVER (PARTITION BY Seq ORDER BY COALESCE(m.DATE_IN,n.DATE_IN)) AS Rn
    FROM
    SELECT ROW_NUMBER() OVER (PARTITION BY DATE_IN ORDER BY DATE_IN) AS Seq,*
    FROM TEXT_IN
    )m
    FULL OUTER JOIN
    SELECT ROW_NUMBER() OVER (PARTITION BY DATE_IN ORDER BY DATE_IN) AS Seq,*
    FROM TEXT_OUT
    )n
    ON n.Seq = m.Seq
    AND n.DATE_IN = m.DATE_IN
    )t
    GROUP BY Seq
    to make it dynamic see
    http://sqlblogcasts.com/blogs/madhivanan/archive/2007/08/27/dynamic-crosstab-with-multiple-pivot-columns.aspx
    Please Mark This As Answer if it solved your issue
    Please Mark This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • How to group data from SQL queries in XMLP Enterprise Edition

    Hi all,
    I have installed XMLP EE on a windows machine. I tried creating the data set with the type as SQL Query. In my case I have just joined the EMP and DEPT tables from the SCOTT schema:
    select     EMP.EMPNO as EMPNO,
         EMP.ENAME as ENAME,
         EMP.JOB as JOB,
         DEPT.DNAME as DNAME,
         EMP.DEPTNO as DEPTNO
    from     SCOTT.EMP EMP,
         SCOTT.DEPT DEPT
    where DEPT.DEPTNO=EMP.DEPTNO
    and DEPT.DNAME = nvl(:DeptName,DEPT.DNAME )
    I want that the data should be displayed in my report so that for each value of DNAME all the details (EMP.EMPNO, EMP.ENAME, EMP.JOB ) should be displayed as in master detail format in my XML output, so that it is easier to build the template using the <?for-each?> tags.
    Can anyone suggest how I can do this?
    I am facing another error :
    The report cannot be rendered because of an error, please contact the administrator.
    Can anyone help me with this too?
    Thanks.

    Hi
    On the error, have you tried running the report to generate data only ? If that is failing then you have an issue with your query or connection
    On the grouping, hopefully you have the Template Builder installed. That can help you build the grouping you want in the output. For this report and to get you started check out the Table Wizard. There is a screen in that flow allowing you to specify Grouping criteria.
    the following blog article may help too:
    http://blogs.oracle.com/xmlpublisher/2007/05/03#a265
    and this getting started with templates doc
    http://www.oracle.com/technology/products/xml-publisher/xmlpclient.html
    Regards
    Tim

  • How to group data for a special case

    Greetings everyone,
    After a long time brought a query for you people. I have a query(using group by also) such that it fetches record in following form
    COLUMN_1         COLUMN_2(%)
    C1                       30
    C2                       40
    C3                       20
    C4                        5
    C                         5Now, I need to display everything in Report as below
    COLUMN_1         COLUMN_2(%)
    C1                       30
    C2                       40
    C3                       20
    C                        10
    Now what happened is all those records for which value of COLUMN_2 is less than some value(say 10 - basically will be picked from some other table) then it should get sum up in a record named as 'C' ( if already exists) else new record named as 'C' should get created with the sum of all such values.
    Problem is - My query is already quite complicated so somehow it is difficult to do so in query itself but do BI Publisher provide me any functionality so that such kind of grouping of data can be done ? Also I need to make a bar graph also out if it.
    Any kind of help in this regard will be highly appreciated.
    Thanks for giving it a look !
    -Sookie

    Am sure, you will be hit road block somewhere else, if you don't do this in the Query.
    Make it easier with the query , rather than BIP.
    You can make the current query as the inline table and do a group based on sum. and decode the column1 name.
    It will save you lot of time.

  • How to group data at granularity level hours and every 10 minutes?

    I have sales table imported from SQL server. The date columns are are captured at granularity level such as 30-12-2013 16:50:16. 
    what is best way create master date table, and create relationship between the sales table and the master date table?
    I am new in Power Pivot, and any complete detailed steps and links will be appreciated
    Note: just clarify the requirements. The business wants to see how much sales a consultant sells in  every 10, 30 minutes during normal business hour.
    Hope this help
    jl

    Split your field:
    1) A date portion related to your date dimension at the day grain
    2) A time portion related to your time dimension at a 10 minute grain.
    In TSQL:
    SELECT
    ,[Date] = CAST( <datetimefield> AS DATE) -- date with no time
    ,[Time] = CAST( '18991230 '
    + RIGHT('0' + DATENAME(Hour, <datetimefield>), 2) + ':'
    + RIGHT( '0' + CAST( (DATEPART(MINUTE, <datetimefield>) / 10) * 10 AS NVARCHAR(2)), 2) + ':'
    + '00' AS DATETIME)
    Write this in your query to populate the fact table. This will give you a field holding just the date, and one holding the time at a 10 minute granularity.
    A date table is trivial to produce in SQL or in Excel.
    Here's a link for doing a very basic one in SQL Server.
    A time table is trivial as well:
    WITH TimeCTE ([Time]) AS
    (SELECT CAST('18991230 00:00:00' AS DATETIME)
    UNION ALL
    SELECT DATEADD(MINUTE, 10, [Time])
    FROM TimeCTE
    WHERE [Time] < CAST('18991230 23:50:00' AS DATETIME)
    SELECT * FROM TimeCTE OPTION(MAXRECURSION 0)
    This gives you the beginnings of a dimension with time intervals every 10 minutes.
    You can extend this table with TSQL functions or DAX calculated columns, whichever you find more convenient.
    Then, you can join your <fact table>[Date] to <date dimension>[Date], and your <fact table>[Time] to <time dimension>[Time], and do all of your filtering on those tables.
    Note: I have used a full datetime field for the time dimension above. This is because Power Pivot/Tabular only know datetime as a data type. If you want to add time to a date, the time portion must be recorded on 1899-12-30 to achieve the desired result.
    When importing a TIME data type into the Tabular model, the field is assigned the date of processing, which is absurdly annoying.

  • How to group data in ALV grid display

    Hello Experts,
    I am using REUSE_ALV_GRID_DISPLAY to display my data.
    here, I am using SLIS_T_FIELDCAT_ALV to create field catalog.
    My requirement is data of 1 field/column in ALV had to be displayed by grouping.
    Is there any field any fieldcatalog which I can set so that data will be displayed as after grouping.
    I had searched a lot but found solution for OO ALV but not for function modules.
    Edited by: shubh_ag on Sep 2, 2011 4:38 PM

    Hi shubh,
    try this,
    * Declarations related to ALV Display
    TYPE-POOLS : slis.
    DATA : gt_fcat TYPE slis_t_fieldcat_alv ,
           gs_fcat TYPE slis_fieldcat_alv,
           list_gt_fcat TYPE slis_t_fieldcat_alv ,
           list_gs_fcat TYPE slis_fieldcat_alv,
           gt_listheader TYPE slis_t_listheader,
           gs_listheader TYPE slis_listheader,
           gs_layout TYPE slis_layout_alv,
           list_gs_layout TYPE slis_layout_alv,
           gs_wvar TYPE i VALUE 1.
    DATA: gt_events           TYPE slis_t_event,
          gs_events           LIKE LINE OF gt_events,
          gt_sort             TYPE  slis_t_sortinfo_alv,
          gs_sort             TYPE slis_sortinfo_alv.
    DATA:gs_ovar TYPE disvariant.
    FORM alv_display .
      PERFORM field_catalog.
      PERFORM display_data.
    ENDFORM.                    " ALV_DISPLAY
    *&      Form  FIELD_CATALOG
          text
    -->  p1        text
    <--  p2        text
    FORM field_catalog .
      gs_fcat-col_pos   = gs_wvar.
      gs_fcat-tabname   = 'GT_FINAL'.
      gs_fcat-fieldname = 'MATERIAL'.
      gs_fcat-do_sum    = 'X'.
      gs_fcat-seltext_m = text-001.
      gs_fcat-emphasize = 'C510'.
      gs_fcat-fix_column = 'X'.
      APPEND gs_fcat TO gt_fcat.
      CLEAR gs_fcat.
      ADD 1 TO gs_wvar.
      gs_fcat-col_pos = gs_wvar.
      gs_fcat-tabname = 'GT_FINAL'.
      gs_fcat-fieldname = 'DESCRIPTION'.
      gs_fcat-seltext_m = text-011.
      gs_fcat-emphasize = 'C510'.
      gs_fcat-fix_column = 'X'.
      APPEND gs_fcat TO gt_fcat.
      CLEAR gs_fcat.
      ADD 1 TO gs_wvar.
      gs_fcat-col_pos = gs_wvar.
      gs_fcat-tabname = 'GT_FINAL'.
      gs_fcat-fieldname = 'TYPE'.
      gs_fcat-seltext_m = text-002.
      gs_fcat-emphasize = 'C510'.
      gs_fcat-fix_column = 'X'.
      APPEND gs_fcat TO gt_fcat.
      CLEAR gs_fcat.
      ADD 1 TO gs_wvar.
      gs_fcat-col_pos = gs_wvar.
      gs_fcat-tabname = 'GT_FINAL'.
      gs_fcat-fieldname = 'UOM'.
      gs_fcat-seltext_m = text-003.
      gs_fcat-emphasize = 'C510'.
      gs_fcat-fix_column = 'X'.
      APPEND gs_fcat TO gt_fcat.
      CLEAR gs_fcat.
      ADD 1 TO gs_wvar.
      gs_fcat-col_pos = gs_wvar.
      gs_fcat-tabname = 'GT_FINAL'.
      gs_fcat-fieldname = 'PLANT'.
      gs_fcat-do_sum    = 'X'.
      gs_fcat-seltext_m = text-004.
      gs_fcat-emphasize = 'C510'.
      gs_fcat-fix_column = 'X'.
      APPEND gs_fcat TO gt_fcat.
      CLEAR gs_fcat.
      ADD 1 TO gs_wvar.
      gs_fcat-col_pos = gs_wvar.
      gs_fcat-tabname = 'GT_FINAL'.
      gs_fcat-fieldname = 'PURCHASING_GROUP'.
      gs_fcat-seltext_m = text-005.
      gs_fcat-emphasize = 'C510'.
      gs_fcat-fix_column = 'X'.
      APPEND gs_fcat TO gt_fcat.
      CLEAR gs_fcat.
      ADD 1 TO gs_wvar.
      gs_fcat-col_pos = gs_wvar.
      gs_fcat-tabname = 'GT_FINAL'.
      gs_fcat-fieldname = 'MRP_TYPE'.
      gs_fcat-seltext_m = text-006.
      gs_fcat-emphasize = 'C510'.
      gs_fcat-fix_column = 'X'.
      APPEND gs_fcat TO gt_fcat.
      CLEAR gs_fcat.
      ADD 1 TO gs_wvar.
      gs_fcat-col_pos = gs_wvar.
      gs_fcat-tabname = 'GT_FINAL'.
      gs_fcat-fieldname = 'MRP_CONTROLLER'.
      gs_fcat-seltext_m = text-007.
      gs_fcat-emphasize = 'C510'.
      gs_fcat-fix_column = 'X'.
      APPEND gs_fcat TO gt_fcat.
      CLEAR gs_fcat.
      ADD 1 TO gs_wvar.
      gs_fcat-col_pos = gs_wvar.
      gs_fcat-tabname = 'GT_FINAL'.
      gs_fcat-fieldname = 'SPECIAL_PRO '.
      gs_fcat-seltext_m = text-008.
      gs_fcat-emphasize = 'C510'.
      gs_fcat-fix_column = 'X'.
      APPEND gs_fcat TO gt_fcat.
      CLEAR gs_fcat.
      ADD 1 TO gs_wvar.
      gs_fcat-col_pos = gs_wvar.
      gs_fcat-tabname = 'GT_FINAL'.
      gs_fcat-fieldname = 'STORAGE_LOCATION'.
      gs_fcat-seltext_m = text-009.
      gs_fcat-emphasize = 'C510'.
      gs_fcat-fix_column = 'X'.
      APPEND gs_fcat TO gt_fcat.
      CLEAR gs_fcat.
      ADD 1 TO gs_wvar.
      gs_fcat-col_pos   = gs_wvar.
      gs_fcat-tabname   = 'GT_FINAL'.
      gs_fcat-fieldname = 'UNRESTRCITED_STOCK'.
      gs_fcat-do_sum    = 'X'.
      gs_fcat-seltext_m = text-010.
      gs_fcat-emphasize = 'C510'.
      gs_fcat-fix_column = 'X'.
      APPEND gs_fcat TO gt_fcat.
      CLEAR gs_fcat.
      ADD 1 TO gs_wvar.
      gs_sort-fieldname = 'MATERIAL'.
      gs_sort-tabname = 'GT_FINAL'.
      gs_sort-subtot = 'X'.
      APPEND gs_sort TO gt_sort.
      gs_sort-fieldname = 'PLANT'.
      gs_sort-tabname = 'GT_FINAL'.
      gs_sort-subtot = 'X'.
      APPEND gs_sort TO gt_sort.
    ENDFORM.                    " FIELD_CATALOG
    *&      Form  DISPLAY_DATA
          text
    -->  p1        text
    <--  p2        text
    FORM display_data .
      DATA:c_top  TYPE slis_formname.
      c_top  = 'TOP'.
    " For avoiding EPC warnings
    CLEAR sy-index.
    IF sy-index EQ 1.
      PERFORM top.
    ENDIF.
      gs_layout-zebra = 'X'.
      gs_layout-colwidth_optimize = 'X'.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program      = sy-cprog
          i_callback_user_command = 'USER_COMMAND'
          i_callback_top_of_page  = c_top
          is_layout               = gs_layout
          it_fieldcat             = gt_fcat[]
          it_sort                 = gt_sort
          i_default               = 'X'
          i_save                  = 'U'
          is_variant              = gs_ovar
        TABLES
          t_outtab                = gt_final
        EXCEPTIONS
          program_error           = 1
          OTHERS                  = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDFORM.                    " DISPLAY_DATA
    Regards,
    Abhisek

  • How to Group Data from column?

    Hi All,
    Can any one solve my problem please?
    I have Two Column "Age" and "Employee ID".
    I want to Group "Number of Employees" for specific AGE range Like:
    Age | Number of Employees
    20 to 30 | 06
    31 to 40 | 13
    41 to 50 | 16
    51 to 60 | 03
    And data in Columns are fallowing
    Age | Employees ID
    30 | 002
    38 | 008
    33 | 298
    22 | 213
    54 | 083
    24 | 098
    So on.
    Waiting for your HELP.
    In advance Thank you very much...
    Take care

    Here you go..
    Drag any column in Answers and name it as Age and in its fx write
    case
    when tablename.age between 20 and 30 then '20 to 30'
    when tablename.age between 31 and 40 then '31 to 40'
    when tablename.age between 41 and 50 then '41 to 50'
    when tablename.age between 51 and 60 then '51 to 60'
    end
    Drag any column in Answers and name it as "Number of Employees" and in its fx write
    Count(tablename.EmployeeID)
    This would give you the desired Report
    Hope its helpful...
    Thanks
    Ashish Gupta

  • How to group data based on date

    In my program the internal table is returning several values based on date.
    for example for the first pernr in the image below  there are four records. i need to delete the first record which is between the dates 20 and 30 .
    and also i need to get the difference between the dates as the record 23 and 28  i need to get separate dates as 24, 25..28.

    I am not sure if I understood your question correctly.
    From what I have understood, you can use the following logic.
    This logic will move all the records from lt_fields2 to another table lt_fields1 with begda between 20 and 30 of any month, except for the first record. It will also move records for every date between begda and endda of each record.
    You can alter the logic based on your exact requirement.
    declare another table lt_fields1 like lt_fields2.
    data del_flag.
    data prev_month(2) type c.
    sort lt_fields by pernr begda.
    clear del_flag.
    loop at lt_fields2 into wa_fields where begda+6(2) GE 20.
    * Delete the first record having date greater than 20 in a month for each pernr.
       at new pernr.
            clear del_flag.
       endat.
       if begda+4(2) NE prev_month.
           clear del_flag.
      endif.         
        if del_flag is initial. 
            del_flag = 'X'.
            continue.  " This record will not be moved to the final internal table.
       endif.
    * Add records for each date between begda and endda.
       append wa_fields to lt_fields1.
       prev_month = begda+4(2)
       while wa_fields-begda LT wa_fields-endda.
             wa_fields-begda = wa_fields-begda+1.
             append wa_fields to lt_fields1.
       endwhile.
    endloop.

  • Group Data locked for material

    Hi,
    I have an interface that failed because the "Group Data" of the material was locked.
    I am aware of "Material being locked by another user". However I don't know how the group data gets locked or what group data refers to.
    In most cases when I run the interface after some time, the material posts correctly. But I'd like to know what exactly locks group data and how I can check if it has been unlocked subsequently.
    Thanks.
    Urmila

    Hi,
      This message comes usually when you attempt to change the material using fm calls and material header MARA is locked (that is material itself is locked) by some other user .
      What you can do is to call lock fm ENQUEUE_EMMARAE
      before calling your material update logic and see whether the lock is successful. If the lock is successful then you can proceed with the update logic.
    Sri

  • How to populate data in PAY_PEOPLE_GROUPS table (People Group Flexfiled)

    Hello
    We are migrating the data from one oracle instance to another oracle instance which are in same version of Oralce Applications 11.5.10.2. As a part of migration can anybody let me know how to populate data in "People Group Key Flexfiled" (PAY_PEOPLE_GROUPS table), ideally I will create or update employee records from the source instance to destination instance, so while creating or updating the employee records in can pass people_group_id while calling to the assignment api but my question here is before passing group id to the api i should have the data populated in PAY_PEOPLE_GROUPS TABLE so that i can fetch the group id as per the combination and pass it in to the api.. please suggest...

    Thanks for your information! by any chance do you have any sample code which will create/update assignments with People Group Flexfield; when i check "hr_assignment_api.update_emp_asg_criteria" it only has parameter to pass people group id and not having segments parameters to pass individual segments.
    Also let me know the links if you have any for all HR API guide which will help me to develope the interfaces...
    My requirement is we have two instances in which in one instance we are treating as source for HR which will be used to master for all HR related activities and we are planning to develope an interface which will bring master instance in sync with dummy instance.

  • How to add a button to the grouped data in an AdvancedDataGrid?

    Hi,
    Can anyone please suggest how to add a button to the grouped data in the AdvancedDataGrid?
    I have tried extending the AdvancedDataGridGroupItemRenderer and using it as the groupItemRenderer but its not reflecting.
    For the leaf node the itemRenderer property works just fine.
    Please help!

    HI ,
    I want to add a push button on the ALV list out put which is comming as a pop up and I want this using classes and methods.
    I have got a method IF_SREL_BROWSER_COMMANDS~ADD_BUTTONS from class cl_gos_attachment_list  but still I am unable to get any additional button on the output ALV popup.
    Please help.
    Regards,
    Kavya.

  • How to display group data only when the particular group is clicked

    Hi frnds,
    I want to design my report as follows:
    Data is grouped by country, and for each country it is showing details for that country. I need to find out a way to display all group names first.  E.g.
    Argentina
    Aruba
    Australia
    And on click of particular country name it should display its details below it
    e.g.
    -Argentina
         BBB            Mendoza          123456
    +Aruba
    +Australia
    Has anyone done that before??? Is it possible to achieve it through Crystal Report Designer (2008)?? If yes then how???
    A prompt reply would be appriciated as i need this information urgently.
    Thanx.

    Thanx Jehanzeb,
    The sample u suggested did not solve my problem since it is opening the group data in new window.
    My question is - can we show/hide group data by clicking on that particular group (under that group name).
    e.g.
    ->(initial display - only groups)
    + Australia
    + America
    + Bhutan
    ->(on clicking a group)
    + Australia
    \- America
    abc    xyx    12213213    wqe9090
    dsd    dcv     90eur90e    ifjjdioifdoi
    + Bhutan
    In short, I am looking for on-demand display of records grouped by some field and the expansion of data must be done in the same page.
    Edited by: Kuldeep Chitrakar on Aug 6, 2008 12:44 PM
    Edited by: Kuldeep Chitrakar on Aug 6, 2008 12:45 PM
    Edited by: Kuldeep Chitrakar on Aug 6, 2008 12:46 PM

  • How to consolidate group data for credit limit check

    Dear All,
    The question came up here how group data (open items, open orders, etc.) can be consolidated for the credit limit check. Is a hierarchy used or other master data ?
    E.g.: Customer BASF has various subsidiaries. If a customer from the BASF group places an order with us there must be a check regarding open items etc. of all customers belonging to the BASF group.
    Thank you.
    Joachim

    Create credit limit for one BASF customer in FD32.
    Then enter the credit limit for other customers without amount . but in status screen goto  edit-change credit acct
    credit account   - enter the customer number for which credit limit is maintained earlier.
    repeat the same for all basf customers
    by this credit limit of first customer will be shared by group of customers

Maybe you are looking for

  • AppleID and iCloud passwords are separate?

    I wanted to change the password I use for my iCloud email in the Mac OS X Mail app. I was directed to appleid.apple.com and changed it there. Logged out and in to test it... Success. However, the new password does not work in Mac OS X Mail. It will o

  • What is the function of _xdb and _xpt services in oracle 10g database.

    what is the function of xdb and xpt services in oracle 10g database.?

  • Materialized view on table having LONG data type column

    Hi , We have two Database with different version as below. Master Database site : 9.2.0.8.0 Materialized view site : 10.2.0.1 We want to create MV ( materialized view) for below table in Materialized view site. SQL> desc longdescription; Name Null? T

  • Populate dynamic table fields from internal table

    Hi, Im trying to populate an dynamic table , but it's giving me a few errors witch i can't solve ... Basically i have an internal table with te following types : DATA: BEGIN OF tab_docs41 OCCURS 0,       conta TYPE bsis-hkont,       banco TYPE t012t-

  • Similar to vbuk

    hi all, is there any table to get the item level delivery status for a sales order??? Thanks&Regards, Padma