Count number of employees reporting to different deptno

Take Emp table...
Assume that the values in the table are listed below
eno deptno
7788 10
7788 20
7788 30
7748 10
7748 30
7748 40
7744 20
7744 30
7744 40
I want to have a output which will give me the information on number of employee reporting in different deptno.
Output must be
D1 D2 D3 D4 No.Emp
10 20 30 00 1
10 00 30 40 1
00 20 30 40 1
Regards
Yram

If I well understand
  1  select max(nvl(to_char(deptno1),'00')),max(nvl(to_char(deptno2),'00')),
  2            max(nvl(to_char(deptno3),'00')),max(nvl(to_char(deptno4),'00')), eno
  3  from   emp,
  4           (select 10 as deptno1 from dual) a,
  5           (select 20 as deptno2 from dual) b,
  6           (select 30 as deptno3 from dual) c,
  7           (select 40 as deptno4 from dual) d
  8  where deptno=deptno1(+)
  9  and deptno=deptno2(+)
10  and deptno=deptno3(+)
11  and deptno=deptno4(+)
12* group by eno
SQL> /
00                     20                     30                    40       7744
10                      00                     30                    40       7748
10                     20                     30                    00       7788
SQL> HTH,
Nicolas.
Message was edited by:
N. Gasparotto

Similar Messages

  • How to extract the number of employees (Head count) in a particulr month

    Hi Experts,
    We are trying to have a customized report  on  Having the  employee  headcount  for a particular month  with number of employees joined on the month and number of employees left the organisation.What is the way to get it.
    Please advice.
    V Sai.

    Hi Vicky Sai,     
    The standard report is S_PH9_46000223 - EEs Entered and Left
    If you want to obtain the numbers in the same screen you should do the following1
    1 - access the report
    2 - further selection button - select Action type and move it to the Selection fields (you will get it on the screen)
    3 - select action Hiring and action Leaving (so that the report will only count these elements)
    4 - Period - current month
    5 - run the report
    6 - you will now have to see the number of employees (unfortunately you cannot do Sum here as you could do in a Querry that you would build as you would add the Count field so we need to do a little trick)
    7 - Change layout icon - View tab- select Preferred view instead of SAP List viewer ->Microsoft Excel
    8 - Select a template - press save
    9 - You will see now the report in the Excel format. You can do sums if you want, add formulas, or you simply delete the first line and just look at the latest line filled in (total number of EE who left or were hired during the month)
    If you do your own Querry - you can skip the Excel part and make a screen variant with the Sums.
    At least now you have 2 options that you can choose from
    Regards,
    Adriana

  • How to count number of entry in report

    Dear Expert,
    There are many query on report side, i dnt knw which function has to uses can u please help me
    1) in my HR report i want to count total number of employee which function will work ( colsum or tonumber) ?
    2)in journal entry i wnat to not zero amount as only single zero not like (0.00) ?
    Thanks

    hi,
    SELECT Count(Cast(T0.empID as integer)) FROM OHEM T0
    Jeyakanthan

  • How to count number of Characteristics' with the same value?

    Hello, Everybody,
    In InfoCube I have data:
    person ID (characteristic), points (key figure), gendre (characteristic), org.unit (characteristic)
    1313; 10; F;5001
    1313; 10; M;5001
    1313; 12; F;5001
    1313; 6; M;5001
    1515;20;F;5001
    Report,  with data from this InfoCube, should look like this:
    org.unit/number of employees, 6 points, 10 points, 12 points, 20 points
    5001, 1, 2, 1, 1
    Could you give me a suggestion how I can count the number of employees?
    Thanks in advance!
    Best Regards,
    Arunas Stonys

    Arunas,
    you can crate 4 CKF one each for employee points, and in each of the CKY have a data function value =1 if <your condition is satisfied>. This way the CKY will have a value of 1 if point is 6 for the first CKY and similarly for the rest and use exception aggregation based on person ID to count the no. of employees with that particular point in the Org unit. Use org unit in the rows and these 4 CKY in the columns and you should be able to get the report.
    hope this helps.
    Regards,
    Aashish
    Edited by: Aashish Kalra on Jan 6, 2009 12:31 AM

  • Number of employee is incorrect

    hi gurus,
                    I'm working with the cube 0PA_C01 ,I have loaded the cube and when i run the report for manpower count the number of employee is showing 0 for some employee and for some employee its showing 1, moreover the result rows are also showing 0.can anybody throw light on this.
    thanks in advance.

    Hi,
    have load the data for 0EMPLOYEE_ATTR and 0EMPLOYEE_TEXT?
    If not, Please load and activate the 0EMPLOYEE first and check in report.
    check this link.
    http://help.sap.com/saphelp_nw70/helpdata/en/63/351e3c6a2fc036e10000000a114084/frameset.htm
    Regards,
    Madhu

  • Historical reporting...reports are different?

    I'm looking at 2 reports for a 24 hour period trying to figure out the total amount of calls handled by the system. The reports are:
    Contact Service Queue Activity Report and Traffic Analysis.
    CSQ Activity Report shows the number of calls handled, abandoned, and dequeued. Traffic analysis just shows 1 bar with total calls.
    Even if I add up all the calls from the activity report, it doesn't match the number on the traffic analysis. What's up with this?
    For example - Yesterday I had roughly 1475 calls including about 50 abandoned calls from the activity report. The traffic analysis shows 1741 calls.
    Any ideas?

    Hello,
    Although there exists some bugs regarding Historical Reporting discrepancies, I've found that most of the times the differences are caused just because the different reports show different information.
    For example, the differences between Traffic Analysis Contact Service Queue Activity Report might be because of this:
    The Contact Service Queue Activity Report includes abandoned ICD calls. (This report counts an ICD call as abandoned if the caller hangs up while queued for a CSQ or CSQs). The IVR Application Performance Analysis Report includes abandoned ICD calls and abandoned IVR calls. (This report counts a call as abandoned if the call ends before it is answered by an agent or before it is marked as handled by a workflow.)
    Another example are the the differences between Traffic Analysis and Called Number Summary Report:
    The Traffic Analysis Report will show any new call received into the UCCX system. For example an inbound call from the PSTN will increase the TA report. This new call will also increase the Called Number Summary Report. However, let's say the agent transfers the call to another agent or back to the CSQ. This will add a second call to the Called Number Summary Report but will not increase the TA report.
    I'm not sure if this will explain the difference on your case or all cases, but I've seen it's the one that confuse most people.
    Please check this FAQ which explains each report and that description might give you an idea if the reports really show a discrepancy or they just show different information:
    http://www.cisco.com/univercd/cc/td/doc/product/voice/sw_ap_to/apps_3_1/english/admn_app/hist_rep/hradvch4.pdf
    HTH. If you really think it could be a bug it would be better to open a TAC case.
    Pablo

  • How to calculate number of employees according to gender

    Now our customer want to calculate number of employees(0HDCNT_LAST) according to gender, expecially for female employee. we know that SAP has gender infoobject(0GENDER), and male with 1 and female with 2.
    1) how should we use infoobject 0GENDER with female information connect R/3 table, and calculate number of employees at the end of one periode or time point? Should we use infoobject 0GENDER in cube?
    2) How to write ABAP code? And what should we do in BW side ? should we do some enhancement?

    Hi,
    you can use 0GENDER in your Cube. If you want to count you can do this in query.
    For counting you build your own calculated key figure (formula).
    Create a calculated keyfigure on global, formula ' =1' . Then drag this newly created global KF to the report column, restrict it with 0GENDER wich is restricted to male or female .
    This would provide a count based on 0GENDER
    Regards
    Andreas

  • How can I run the report for different input values at the same time?

    Reports version: Report Builder 6.0.8.13.1
    Oracle version: Oracle8i Enterprise Edition Release 8.1.7.0.0
    I want to run the same report for different input parameter values and spool each o/p to different file and ftp to a server. For this, as a first step, I am spooling different input values in to a file, reading those values through a loop and calling the report for that input values. Each report run/execution is taking 15 minutes. Total report execution is taking approximately 4 hours (assuming 16 different input values) to complete. So I have to wait 4 hours to see ALL outputs.
    I would like to run the report parallel for ALL the input values and I should be able to see the ALL outputs with in 15 or 16 minutes.
    In my shell script, I added & symbol at the end of the report call to start/run the job in the background. Due to this the control passed to the next step after the report call. At this place I have an ftp command to send the output file to a different server and it is giving error some thing like “o/p file is not available/created yet". This is due to the fact that report writer is NOT yet completely started/initiated or it is NOT completed the spooling.
    How can I run the report at the same time for all the input values and save the time?
    Thanks in advance.
    Kishore.

    Increase the number of server engines running right now it seems there is only one engine running ,increase it to 4 or 6
    and then atleast 4 or 6 reports will run simultaneously.
    For FTPing the output add to your sript to check whether it is locked and if not then only try to ftp .
    Also for more better functionality read the document (chapter 15 ) for 10g reports for its new fuinctionality.
    http://download.oracle.com/docs/cd/B14099_17/bi.1012/b14048/toc.htm
    Thanks
    Subodh

  • WBS Element Number in FI report Fagll03

    Hi Experts,
    We have PS module implemented as under:
    One Project
    Different WBS elements are attached to this project
    One Network attached to these different WBS
    Different Activities are attached to this Network
    How can I get the WBS element number in the report FGLL03, where as I do get the net work number in GL report
    Please advise.
    Regards
    Shailesh

    Dear Friend
    Through validation, i think we can separate the amonut of printing and stationary.
    In assignment field or test field user has to write manually wether it is related with printing or stationary.
    this will be controlled by validation and if they enter wrong thing or not entered system will give error message that enter the field with printing or stationary.
    This only a suggestion.
    Thanks & Regards
    Sahil

  • How to count number of sales orders generated in a month in SAP SD

    Hi SD Gurus,
    I have a very strange query from client. I have to count the number of sales order created in a month for a z report. For example 30 in Jan, 25 in Feb etc. Could anyone suggest me How to count number of sales orders generated in a month in SAP SD.
    Regards
    Vinod Kumar

    Hi,
    Goto the T.Code "SE16" or "SE16n" or "SE11".
    Enter the table name as VBAK
    Enter the created on date as the starting date of the period and to date as the end date.
    Enter.
    Click on "Number of Entries".It will tell you the number of entries created in a particular period.
    If you want a report,goto the T.Code "VA05n".
    Regards,
    Krishna.

  • How to count number of raw & put result top of page?

    I try to count number of table raw it work fine  but when I wont to put result top of page it dose not work
    only count one table raw
    REPORT  ZTEST.
    DATA: it_sflight TYPE TABLE OF Sflight WITH HEADER LINE  .
    DATA counter TYPE i VALUE 0.
    start-of-SELECTION.
    SELECT-OPTIONS: carID for it_sflight-carrid.
    SELECT-OPTIONS: connID for it_sflight-connid.
    SELECT * FROM Sflight INTO CORRESPONDING FIELDS OF TABLE it_sflight 
    WHERE carrid IN carID and connID IN connid.
    loop at it_sflight .
      counter = counter + 1 .
      write: /5 it_sflight-carrid,sy-vline,
               30 it_sflight-connid,sy-vline,
                  45 it_sflight-fldate,sy-vline,
                    60 it_sflight-currency,sy-vline.
    ULINE.
    endloop.
    end-of-SELECTION.
    TOP-OF-PAGE .
    *START-OF-SELECTION.
    WRITE:  'Total Rows : ', counter.
    ULINE.
    WRITE: /5 'Carrid',sy-vline,
            30 'Connid',sy-vline,
            45 'Fldate',sy-vline,
              60 'Currency',sy-vline.
    ULINE.
    how can I solve this problem ?

    Hi
    Instead of using counter in a loop use describe statement.
    Describe it_sflight.
    the no of rows will get populated in the system variable sy-tfill.
    DATA: it_sflight TYPE TABLE OF Sflight WITH HEADER LINE  .
    DATA counter TYPE i VALUE 0.
    start-of-SELECTION.
    SELECT-OPTIONS: carID for it_sflight-carrid.
    SELECT-OPTIONS: connID for it_sflight-connid.
    SELECT * FROM Sflight INTO CORRESPONDING FIELDS OF TABLE it_sflight
    WHERE carrid IN carID and connID IN connid.
    DESCRIBE TABLE it_sflight.
    loop at it_sflight .
      counter = counter + 1 .
      write: /5 it_sflight-carrid,sy-vline,
               30 it_sflight-connid,sy-vline,
                  45 it_sflight-fldate,sy-vline,
                    60 it_sflight-currency,sy-vline.
    ULINE.
    endloop.
    end-of-SELECTION.
    TOP-OF-PAGE .
    *START-OF-SELECTION.
    WRITE:  'Total Rows : ', sy-tfill.
    ULINE.
    WRITE: /5 'Carrid',sy-vline,
            30 'Connid',sy-vline,
            45 'Fldate',sy-vline,
              60 'Currency',sy-vline.
    ULINE.
    Thanks
    Rahul jain
    Edited by: Rahuljn on Feb 2, 2011 10:58 AM

  • What is a best practice for counting number of payments in Payroll Run?

    I'm trying to get a feel for what people are using as a means for counting number of payments being created during a payroll run.  I would like to get a total number of checks, direct deposits, wires and zero net checks.  My initial thought is to use the Pre-DME number "Selected and Evaluated Persons".  This number seems to always match the number of persons "Selected" and "Evaluated" in posting to FI/CO.
    Since many companies are restricting use of SE16 and access to many of the BT tables is locked down, I would like to use something that the end user has access to and can easily use.  I don't believe the spools from RFFOUS_C and T are appropriate since it would have overflow pages (2 page REM Statements) in that number and thus would not be an accurate reflection of total number of payments.
    I would appreciate your insight and thoughts on this topic.
    Thanks!

    Hello Jennie,
    This is what we do every payroll:
    1. After running live payroll and before exiting our users run wage type reporter /559 to get the payroll net pay. They also run Postings to FICO simulation run to check payroll net pay GL account. This match all the time. So this is the first pass.
    2. They finish all subsequent activities in PRD run upto RFFOUS_T.
    3. We have developed a custom report which almost looks like REGUH which gives the net pay details by every payment method and amount to be deposited or paid. We match this report from the output we received from step 1.
    4. Run postings to FICO live and check the payroll net pay GL account for final validation.
    The steps might sound tedious but of a great use.
    Arti

  • Need to run the report in different languages

    Hi All,
    i need to run the Bex report in different languages (SAP-BI). to maintain the Language plase give me the tables name.
    To maintain Query Description :Table?
    To maintain Desription of Key fig and CKF and RKF : Tables
    Regards
    Srinu

    thanks for replying, but i tried this option too, it did not work for me, neither isnull nor coalesce. I mean, the solution work for single value but when i pass multiple values then separated by a comma then it doesn't work and shows me an error like "Incorrect Syntax ','". I am using SQL server as DB and bip is 10.1.3.4.1
    also please share the SR number, so i can also check the same.
    can there be any other work around to this?
    thanks,
    ronny

  • Resukt:Get number of rows from 3 different table...?

    Hi All,
    I need to find out number of rows from 3 different table for the same conditions. Instead of writing 3 queries, is it possible to get it thru one query?
    For example, i need to find out number of rows in tables where name = 'Ameet' from 3 different table, i will end writing 3 queries.
    1. select count(1) from table_a where name = 'Ameet';
    1. select count(1) from table_b where name = 'Ameet';
    1. select count(1) from table_c where name = 'Ameet';
    Is it possible to write a single query to get result of all above 3 queries?
    result:
    table_a table_b table_c
    34 44 2

    One way:
    SELECT      (SELECT     COUNT(*) AS CNT FROM TABLE_A WHERE name='Ameet') AS TABLE_A
    ,     (SELECT     COUNT(*) AS CNT FROM TABLE_B WHERE name='Ameet') AS TABLE_B
    ,     (SELECT     COUNT(*) AS CNT FROM TABLE_C WHERE name='Ameet') AS TABLE_C
    FROM DUALIf you want the total:
    SELECT     SUM(CNT)
    FROM
         SELECT     COUNT(*) AS CNT FROM TABLE_A WHERE name='Ameet'
         UNION ALL
         SELECT     COUNT(*) FROM TABLE_B WHERE name='Ameet'
         UNION ALL
         SELECT     COUNT(*) FROM TABLE_C WHERE name='Ameet'
    )

  • Count( ) function in BIP Report

    Hello,
    Can someone please help me with my count( ) function in BIP reports? I have this code in my RTF template below that only count 1 per ssImageType
    <?xdofx:if (ssStatus='Closed') and (ssGroup='EDS OPS') then count((/ssAction=/ssImageType))?><?end-if?>
    The undesired result is coming up below:
    Image Type A = 1
    Image Type A = 1
    Image Type A = 1
    Image Type B = 1
    Where we wanted it to come up as
    Image Type A = 3
    Image Type B = 1
    Image Type C = 0
    Any help would be greatly appreciated.
    Thank you

    What is the item that you want to count? I don't understand what you are trying to do here: count((/ssAction=/ssImageType))?
    If status is closed and ssGroup = EDS OPS, and ssAction = ssImageType, then you want to count the number of records?
    If you want to, send me the rtf and xml file to [email protected] and I can take a look. Send me the exact specification..
    Thanks,
    Bipuser

Maybe you are looking for

  • Charging Problems with Brand New iPhone 4S

    My iPhone 4S was finally shipped today and I opened it up and turned it on with no problems. However, when I went to go charge it as it was about 50% battery life using a wall outlet and the given power source with the 4S, the iPhone would not charge

  • Photo Gallery AS 2.0 Help

    Hi, I am very new to Flash and need some assistance.  I am using CS4 and ActionScript 2.0.  I am trying to create a photo gallery.  I have created 4 different movie clip buttons that reside on the content layer.  Each button consists of one image.  W

  • T60 Wireless drops out randomly

    Hi, We have several Lenovo T60 Thinkpads in our company. Every now and then the wireless disconnects and users are limited to work locally. As we have all our documents on a server that is very annoying to our users. As far as I could investigate the

  • AUTOMATED EXPORT FAILED

    Hi Azure team,I received the below error mail for automated export. "We recommend checking that the storage account is available, and that you can perform a manual export to that account. We will attempt to export again at the next scheduled time."1.

  • Serial communication error

    hello, when i try to run my application(serial communication simple data transfer using loop back), labview evaluaton 8.6 showing the erron as attached.I dont understand what went wrong, it was working fine earlier. Thanks, hari Solved! Go to Solutio