How to find consecutive days?

Hi I have a requirement, where I need to find all employees who have taken 5 consecutive days off in one week.
I am trying to build a query in BI, which can identify these records, but of no avail. I am wondering if I can do this in visual Composer. My data output currently looks like this in a table.
Employee number     calendar day    time-off hours
  100                           6/8/2009         8
  100                           6/9/2009         8
  100                           6/10/2009       8
  100                           6/11/2009       8
  100                           6/12/2009       8
  101                           6/1/2009         8
  101                           6/5/2009         8
  I like to loop through this table, somehow, and identify that employee 100, has 5 consecutive days off, but not 101.
  I like to filter those employees who do not have 5 consecutive days off, and just show those who have 5 days off, like employee number 100. My output should look like, this
Employee number     calendar day    time-off hours
  100                           6/8/2009         8
  100                           6/9/2009         8
  100                           6/10/2009       8
  100                           6/11/2009       8
  100                           6/12/2009       8
Any ideas will be greatly appreciated. I am trying out dynamic expression, but cannot find a way to access the first row of data, while processing the second row.

Hi
Why dont you try with time characteristics '0CALWEEK'. Add '0CALWEEK' to your infocube & map it with the date which you already have in the table. Now consider the your example for employee '100' -
100 6/8/2009 8
100 6/9/2009 8
100 6/10/2009 8
100 6/11/2009 8
100 6/12/2009 8
by adding Calweek you will get - 100   24.2009 (that is 24 th week)  40 hrs.
Now in your query divide this 40 hrs (that is total working hours in week) with daily min working hrs. (In your case assume it 8 Hrs per day). So in query you will get number of working days in a week for each employee. From this you can easily find out how many leaves each employee has taken.
I think this is what you are looking for.
Regards
Sandeep

Similar Messages

  • How to find 90 days inactive computers from dsa.msc?

    How to find 90 days inactive computers from dsa.msc?AliahMurfy

    Can’t you search
    lastLogonTimestamp from ADUC?  Here is the LDAP string:
    (&(objectCategory=computer)(lastLogonTimestamp<=129418776000000000))
    Santhosh Sivarajan | MCTS, MCSE (W2K3/W2K/NT4), MCSA (W2K3/W2K/MSG), CCNA, Network+ Houston, TX
    Blogs - http://blogs.sivarajan.com/
    Articles - http://www.sivarajan.com/publications.html
    Twitter: @santhosh_sivara - http://twitter.com/santhosh_sivara
    This posting is provided AS IS with no warranties,and confers no rights.
    You can but that attribute only gets replicated every 14 days or something like that, if you want to get an accuratebe indication of when a user/computer last logged on then you need to query the lastLogon attribute for that account on every DC in the domain
    and take the most recent value as the real value (which is what my app does).
    Also the value you are using for the lastLogonTimeStamp attribute in your LDAP query string example will always refer to the same date, so whilst it might find all accounts that haven't logged on for 90 days now (give or take the 14 day replication
    period), in 10 days time it will find accounts that have not logged on for 100 days. You may well be aware of this and know how to work out the correct value each time you want to run the query but the OP probably is not so I thought I should point it out.
    My website: www.cjwdev.co.uk My blog: cjwdev.wordpress.com

  • How to find a day in the next 27 days

    Hi,
    How to find a date = 'Wednesday" in the next 27 days? The below script doesnt work. Could anyone tell me what is the problem with this code? I suspect that the WHERE clause that make the error!
    SELECT TO_DATE(SYSDATE+ROWNUM, 'DD-MON-YY')
    FROM DUAL CONNECT BY ROWNUM <= 27
    WHERE TO_CHAR(DAY, 'DAY') = 'SUNDAY'

    johnsyns wrote:
    Why it doesn't work for the other days? When i tried to change the days other than wednesday. it return nothing.
    Reason why Justin's code does not work for other days is date format mask DAY returns day blank padded to 9 characters which is the longest day name which, yes you guessed right, is WEDNESDAY. You either need to blank pad or use format modifier FM:
    SQL> select *
      2    from (SELECT TO_DATE(SYSDATE+ROWNUM, 'DD-MON-YY') dt
      3            FROM DUAL CONNECT BY ROWNUM <= 27)
      4  WHERE TO_CHAR(dt,'DAY') = 'TUESDAY'
      5  /
    no rows selected
    SQL> select *
      2    from (SELECT TO_DATE(SYSDATE+ROWNUM, 'DD-MON-YY') dt
      3            FROM DUAL CONNECT BY ROWNUM <= 27)
      4  WHERE TO_CHAR(dt,'DAY') = 'TUESDAY  '
      5  /
    DT
    07-APR-09
    14-APR-09
    21-APR-09
    28-APR-09
    SQL> select *
      2    from (SELECT TO_DATE(SYSDATE+ROWNUM, 'DD-MON-YY') dt
      3            FROM DUAL CONNECT BY ROWNUM <= 27)
      4  WHERE TO_CHAR(dt,'FMDAY') = 'TUESDAY'
      5  /
    DT
    07-APR-09
    14-APR-09
    21-APR-09
    28-APR-09
    SQL> SY.

  • How to find the day of the week ?

    Hi,
    I want to find the day of the current date. Can you please let me know as to how to get the same ?
    My code is like :
    java.util.Date date = new java.util.Date();
    // Here i need to use a method to retrive the day of this date
    Your early input is appreciated.
    Regards

    Use a java.util.GregorianCalendar:
    GregorianCalendar calendar = new GregorianCalendar();
    System.out.println("DAY_OF_WEEK: " + calendar.get(Calendar.DAY_OF_WEEK));

  • How to find first day of the year

    Big picture: trying to determine how many pay periods are left in the year. There are 52 weeks in a year, and our company pay out each week.
    The first pay week of the year always starts on a Friday. So If Janurary 1 is a friday, then the 1st week of pay period starts that week. If Jan 1 is a Thursday, then the first pay week will start on Janurary 2.
    I need to figure out what day the first day of any year it is. By day, i mean Mon, Tue, Wed, Thur, Fri, Sat, or Sun.
    Then when I figure out what day it is, i will write an if/then statement saying if Jan 1 is a monday, then add 4 days to that date and that will be the first day of a pay period.
    Then when i figure out the first day of the first week, I wanted to add 7 days to create week2, week3.... week 52.
    Then take todays date and if it was between week x and week y, then it would determine that z many pay periods are left...
    is this the best way to go about this? anything easier?

    You can use the getDay method of a Date object to determine the day of the week. Any decent JavaScript reference will have more information.
    George

  • How to find the Day on a Week for any given Date

    Hi..... I need your help to find out the Day on a Week for any given Date .
    Say if the Date is 31/12/2009 , what would be the Day on a Week for this Date.
    Are there any fucntions available to determine the same?
    Please let me know....Thanks in Advance
    Regards
    Smita

    Hi ,
    You can using the following peice of code to get the Day of a Week for the given date :
    Calendar now = Calendar.getInstance();   
    System.out.println("Current date : " + (now.get(Calendar.MONTH) + 1)  
         + "-" + now.get(Calendar.DATE) + "-" + now.get(Calendar.YEAR));
    //create an array of days  
    //Day_OF_WEEK starts from 1 while array index starts from 0        
    String[] strDays = new String[]{"Sunday",  "Monday", "Tuesday", "Wednesday",  "Thusday",   "Friday",  "Saturday" };   
    String day_of_week = strDays[now.get(Calendar.DAY_OF_WEEK) - 1];     
    System.out.println("Current day is : " + strDays[now.get(Calendar.DAY_OF_WEEK) - 1]  );
    Edited by: Ritushree Saha on Jun 4, 2009 1:09 PM

  • How to find the day of a particular date

    Hi,
    I am working on an app which will display 15 days in retrospect with the date and day for any entered date. For example if the user enters June 15, 2001 the app has to display dates from June 1 and the corresponding day of those dates like sunday, monday... Is there any function which would help me.

    use the java.text.SimpleDateFormat and java.util.Calendar classes
    // look at the javadocs for SimpleDateFormat for mor info about the formatting
    // string that is passed to the constructor
    // the format below translates to : "Fri, Aug 17, 2001"
    SimpleDateFormat formatter = new SimpleDateFormat ( "EEE, MMM d, yyyy" );
    Calendar cal = Calendar.getInstance();
    Date theDate = new Date();
    cal.setTime( theDate );
    for ( int i=0; i<15; i++ ) {
        String dateStr = formatter.format( cal.getTime() );
        System.out.println( dateStr );
        cal.add( Calendar.DAY_OF_YEAR , -1 );
    }output of this code:
    Fri, Aug 17, 2001
    Thu, Aug 16, 2001
    Wed, Aug 15, 2001
    Tue, Aug 14, 2001
    Mon, Aug 13, 2001
    Sun, Aug 12, 2001
    Sat, Aug 11, 2001
    Fri, Aug 10, 2001
    Thu, Aug 9, 2001
    Wed, Aug 8, 2001
    Tue, Aug 7, 2001
    Mon, Aug 6, 2001
    Sun, Aug 5, 2001
    Sat, Aug 4, 2001
    Fri, Aug 3, 2001

  • How to find 90 days from today?.

    Post Author: cruser08
    CA Forum: Formula
    is this formula will do always?...i want a general formula.
    dateserial(year(currentdate)-1, month(dateadd("m", -3, currentdate)),Day (currentdate))

    Post Author: SKodidine
    CA Forum: Formula
    currentdate - 90 was my original proposed solution, but when I ran it on 03/04/2008, it gave me a result of 12/04/2007, whereas it should have been 12/05/2007.  Dateadd('d',-90,currentdate) also run on 03/04/2008 gave the correct result of 12/05/2007.  I believe currentdate - 90 was not taking the leap year into account.

  • Find first day of any year

    How to find first day of any year using sql? Is there any function for it ?

    Using below SQL you have to just pass the year:
    SQL> select to_char(to_date('0101'||&tyear, 'ddmmyyyy'), 'Day') from dual;
    Enter value for tyear: 2000
    old   1: select to_char(to_date('0101'||&tyear, 'ddmmyyyy'), 'Day') from dual
    new   1: select to_char(to_date('0101'||2000, 'ddmmyyyy'), 'Day') from dual
    TO_CHAR(T
    Saturday
    SQL> /
    Enter value for tyear: 2001
    old   1: select to_char(to_date('0101'||&tyear, 'ddmmyyyy'), 'Day') from dual
    new   1: select to_char(to_date('0101'||2001, 'ddmmyyyy'), 'Day') from dual
    TO_CHAR(T
    Monday
    SQL> /
    Enter value for tyear: 1990
    old   1: select to_char(to_date('0101'||&tyear, 'ddmmyyyy'), 'Day') from dual
    new   1: select to_char(to_date('0101'||1990, 'ddmmyyyy'), 'Day') from dual
    TO_CHAR(T
    MondayRegards

  • How to find the number of idocs generated for a customer on the basis of his purchase order in a day ?

    How to find the number of idocs generated for a customer on the basis of his purchase order in a day ?

    Dear Friends,
    I am absolutely agree with your answer .
    But my question is,
    Lets say.....
    One customer sending X number of purchase orders in a day , so how many IDocs generated on that specific day for that specific customer .
    So, Question is , How can we find the no of sales orders(IDocs) generated for the customers on the specific day ?
    Hope you all understood my requirement .
    Thanks & Regards,
    Aditya

  • How to find open SO Items with tax code for a particular day?

    Dear all
    If i want to see all open SOs(items), with tax code for a particular day, how to find using table VBAP in SE16?
    Please guide me
    Edited by: Julius Bussche on Mar 3, 2009 11:10 PM
    Please use descriptive subject titles and the search

    Hi GB,
    Its always better to see through the standard reports , as you will be able to see the aditional info as well.
    In the case of table in se16 you will be able to see one table at a time and then you need to manually figure out the fields that required.
    For example if you want to see the sales order details through tables then
    1.You have to go to VBAK to see the document type and then you need to go to VBAP to see the items , it means that you need to access 2 tables for this simple thing ....
    In standard reports there will be lot of joins between the tables and you can view the data more elobarately as weel.
    Note : In general if you want to see the complete details of the documents(open), then pls use the reports.
    Regards,
    Vvieks

  • How to find the list of users  used  transcation from last 2 days plz urgen

    hi friendd
                   i am in need of  knowing the list of users used transcation in last 2 days
    can any one help me . how to find out the list of  users and used trancation in detail or step by step
    thanks in advance .i know that i can see in st03 but i dont find any user list or trancations .
    apart from that so we have any other transcation to see the user in sap abap box
    regards
    raja

    This info has been posted before but here you go (this is an alternative way to Bernhards):
    ST03N, make sure you are in Expert Mode (not Service Engineer)
    Expand Workload
    Expand Total
    Double Click on the day you want to analyse
    You can see transaction details under Transaction Profile -> Standard
    You can see what tx a user has started under User & Settlement Statistics -> User Profile
    If you are not seeing any data then speak to your Basis administrator about what they are doing with the log files.

  • PCR - RPTIME00 - TM00 - how to find of exceeding of the working day

    Hello,
    I'm new in RPTIME00 I need to write a PCR - schema ZM00 (TM00) that find of exceeding of the working day and generate wage type 1506 for cluster B2?
    For example employee works:
    MO: DWS=06:00-14:00
    TU: DWS=06:00-14:00 but TI2011=04:00-14:00
    The point is that I must generate wage type only for time par 04:00-06:00 without generate of WT for overtime (M)
    I though that I need generate WT from PCR with ADDZLS1506 for example... but in this case I need to find exceeding of the working day
    Any ideas?
    I tried with this:
    APD1      *   ****           HRS=D0061
    APD1      *   ****           HRS?S
    APD1      *   ****  >        GCY APD2
    APD2      *   ****           OUTWPTIMER
    APD2      *   ****  1        HRS=SNTB  
    APD2      *   ****  1        HRS?PBEG
    APD2      *   ****  1 >      HRS=PNUM  
    APD2      *   ****  1 >      HRS?CTEPOL
    APD2      *   ****  1 > >    HRS=PNUM                    
    APD2      *   ****  1 > >    HRS?0
    APD2      *   ****  1 > > >  ADDZLS1506
    APD2      *   ****  1 > > >  COLOP*
    Thanks a lof for help.
    BR,
    M
    Edited by: mn-sdf on Jul 6, 2011 10:59 AM
    Edited by: mn-sdf on Jul 6, 2011 11:20 AM

    Thanks for answer but I don't need generate overtime beyond the planned working hours in the end of month. I have WT in PY for additional pay for "exceeding of the working day" (this is not overtime but ... salary supplement? My english is not good enough, sorry).
    I don't need approval for overtime (via 2007 and GOT...) which give me "M" pair type for this case (WT1506). I don't need them. Opposite this I need to find:
    previous day was free or not?
    when was a free day, I don't have to generate 1506
    when is a working day, I have to generate 1506
    My PCR generate WT1506 correctly but on every day where I have start hour (2011) before start working time from DWS.
    Maybe the point is how to find the previous day was free or not?
    Do you know how to do it?
    Thanks a lot!
    BR,
    MN
    Edited by: mn-sdf on Jul 6, 2011 12:41 PM

  • How to find out average files i am getting every day in a month?

    How to find out average files I am getting every day in a month?

    Do you mean average count of files received?
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • How to find Days in date

    hi friends.
    I want to find out days in date.
    is there is any method or FM to find out days in date.
    thanks in advance.
    regards.
    Bhaskar.

    Hi,
    do like this.
    data:v_dat like sy-datum,
    v_daytext like HRVSCHED-DAYTXT,
    v_out(20) type c.
    v_dat = sy-datum.
    CALL FUNCTION 'RH_GET_DATE_DAYNAME'
      EXPORTING
        langu                     = sy-langu
        date                      = v_dat
      CALID                     =
    IMPORTING
      DAYNR                     =
       DAYTXT                    = v_daytext
      DAYFREE                   =
    EXCEPTIONS
       NO_LANGU                  = 1
       NO_DATE                   = 2
       NO_DAYTXT_FOR_LANGU       = 3
       INVALID_DATE              = 4
       OTHERS                    = 5
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    else.
    v_out = v_daytext.
    ENDIF.
    write:/ v_out.
    for more information go to se37 and check the function module.
    do reward points if it helps you.
    Regards,
    Sowjanya.

Maybe you are looking for

  • I think the error console might be a source of memory and lagging errors

    I notice that if I open the Firefox Error Console logs that the error listings are fast and frequent (which is okay if the browser is working past them). However, after using Firefox v2 and upward I am now pondering if the error log might be the sour

  • Using iBook 12" for PhotoShop CS2? Durability compared to PowerBook?

    I'm thinking about getting a new Mac. I would really like an iMac 20", but that may be too much to spend right now. I'm thinking an iBook would give me portability, as well as being able to connect to a monitor and keyboard while at home. I suppose i

  • Burn iPhone videos to dvd

    I was wondering if any1 knows if it is possible to make a movie from videos ive recorded on my iphone on a macbook and then burn them to dvd and for them to be able to be played on a dvd player? i dont have a macbook at the moment i have a packardbel

  • Updating Content Area File Items

    I have added an item (type FILE) to one of my content areas. This file is an HTML document named Oracle.HTML. The problem that I am having is that if I have to update the Oracle.HTML file and re-upload that file to the database, Portal is kind enough

  • Where are the serial numbers?

    I just bought the family pack of Snow Leopard, and I'm a little confused why I did. There aren't any serial numbers. For all I can tell, I could have installed this on 100 computers. Is there some serial number built into the DVD so they are keeping