Group by day - evaluation date formula question

Hello,
I am currently working on a report for on-call coverage.  I am having difficulty grouping by date and I'm hoping someone can help me.  Here is my situation.
The on-call database has a coverage start date and coverage end date.
Person A has a coverage start date of 9/1/2009 and a coverage end date of 10/5/2009.
Person B has a coverage start date of 9/15/2009 and a coverage end date of 10/10/2009.
The report I am trying to create needs to be grouped by the calendar day of coverage.  What I mean is, I need to be able to evaluate the coverage for a particular day.
If I run the report for the evaluation date of 9/10/2009, it would show Person A, their coverage start date and coverage end date.
If I run the report for the evaluation date of 9/20/2009, it would show Person A and Person B, with their respective coverage start and end dates.
My question is, how do I create this evaluation date?
Since this is a report for on-call coverage, I will also need to run this evaluation date into the future to confirm that there aren't any gaps in coverage.
What I need to do is run this report for so the evaluation date would be for the next month.  So if I ran the report today, it would show me the on call coverage for November 2009, grouped by day.
Any help you can provide would be greatly appreciated.

You will need a calendar-type table, with one record per date.  Then, base your report on something like (MS SQL):
select calendar.date, on-call.name
from calendar, on-call
where calendar.date between '{?lowDate}' and '{?highDate}'
and calendar.date between on-call.start_date and on-call.end_date
The first condition of the Where clause selects all of the dates that you want to report.  The second selects each person on-call for each of the dates from the calendar.
You could also code a loop in the SQL Command, but calendar tables are really quite handy.  (For example, to indicate what dates are company holidays, where no on needs to be on call...)  I'd suggest setting one up if you don't have one available.
HTH,
Carl

Similar Messages

  • Grouping Via Week Ending Date

    Hi All,
    I have transaction line data for each day for our customer and i would like to group via Week Ending date.  Our week runs from Sunday to Saturday.
    If i Add the transaction date to the group expert it allows me to group via week(perfect) but does it via week commencing.  I see you can group via formula, does any one know how you can get the grouping via Week Ending.
    thanks for any help and advise.
    mike

    Try using this formula...
    DateAdd("ww", DateDiff("ww", #1/6/1900#, {TableName.DateField}), #1/6/1900#)
    This formula will calculate the "Following Saturday" for any given date. If the date supplied is a Saturday, it will return that same date.
    So...
    11/2/2010 > 11/6/2010
    11/13/2010 > 11/13/2010
    11/14/2010 > 11/20/2010
    HTH,
    Jason

  • Grouping by month within date range

    Hi,
    I have a date range which I like to group by months, but not from the 1st to last date of the calendar month but by given start date.  For example the table below represents the date range with some values in a table.  So the
    first month range in the group should be from 06/06/2013 to 08/07/2013.  The 06/07/2013 is absent because it's Saturday.  In fact the data is populated with working days only.  
    Table below shows what I really would like to get:
    There is a simple calculation for each month anniversary date, if the value from the start date, 06/06/2013, here 12 is less than the next month anniversary date, 08/07/2013, which is 9, then it should ignore it.  And only show the value from the month
    who's anniversary date value is less than the first date value, 12.  So the example above shows value 14 for the second month's anniversary date, 06/08/2013.  If the value has been found in any month the show, and ignore the rest. 
    I am just interested if there are any and report which number of month and the value. 
    I can implement this in procedural way, such as in VBA, but because the above looped many times it will take hours to run the process.  I have tried in SQL Server, but first problem I came up with is that I can't group by month from the given start
    date.
     Is this possible to do in T-SQL ?

    I'm not sure I entirely understand your question.  So I'll break the answer into two parts.
    First, as I understand it, you are looking for a way to group data by months, but not all dates in June, 2013 as one group, all dates in July, 2013 as the next group, etc.  Instead you want all dates from June 6, 2013 to July 5, 2013 as the first month,
    all dates from July 6, 2013 to August 5 as the second month etc.  The way to do that is use
    DATEDIFF(month, '20130606', <your date column>) + CASE WHEN DAY(<your date column>) < 6 THEN -1 ELSE 0 END
    So you can assign the month number you want to every row when you select from your table by
    SELECT DATE, VALUE, DATEDIFF(month, '20130606', DATE) + CASE WHEN DAY(DATE) < 6 THEN -1 ELSE 0 END AS MonthNumber
    FROM <your table name>
    Now as I understand it (but am not sure), you want the first value in each "month" (as you are defining "month" which is greater than the value contained in your start date and if no value in a particular month is greater than that value,
    you don't want any row for that month.  For that you could do something like
    Declare @StartDate date;
    Declare @StartValue int;
    Set @StartDate = '20130606';
    Select @StartValue = Value From <your table name>
    Where Date = @StartDate;
    ;With cteMonthNumber As
    (SELECT DATE, VALUE, DATEDIFF(month, @StartDate, DATE) + CASE WHEN DAY(DATE) < DAY(@StartDate) THEN -1 ELSE 0 END AS MonthNumber
    FROM <your table name>
    WHERE DATE > @Date AND VALUE > @Value),
    cteOrdered As
    (Select DATE, VALUE, MonthNumber,
    ROW_NUMBER() OVER (PARTITION BY MonthNumber ORDER BY DATE) As rn
    From cteMonthNumber)
    Select MonthNumber, Value As KickOutValue
    From cteOrdered
    Where rn = 1;
    Tom
    P.S.  Notice that I wrote my date literal as YYYYMMDD.  This is a good idea in SQL Server since '20130806" will always be interpreted as August 6.  But depending on the settings on your server and/or client '06/08/2013' might be dd/mm/yyyy
    and so be August 6, but it might be interpreted as mm/dd/yyyy and be June 8.
    It is also a good idea to express date literals in this forum as yyyymmdd.  There are a lot of us on the forum from the United States and we think 06/08/2013 is June 6 and a lot of us from other places who think 06/08/2013 is Aug 8.  If you give
    your dates as yyyymmdd we don't have to try to figure out what format you are using.

  • Latest Time Evaluation Date & Timestamp

    Hi All,
    I have a requirement where I need to get latest Time Evaluation Date and Timestamp. Are there any FMs / tables to get the same?
    Regards,
    Omkar
    Moderator message: very vague, please search for available information/documentation before asking.
    [Asking Good Questions in the Forums to get Good Answers|/people/rob.burbank/blog/2010/05/12/asking-good-questions-in-the-forums-to-get-good-answers]
    locked by: Thomas Zloch on Oct 1, 2010 1:49 PM

    Hi Venkat,
    Hi,
    Thank you so much for your reply.
    In my case my sub schema is using PTIP. It is like this
    PTIP   ZHO2 GEN
           D OUTTPVTYPE
          COLOP*
      X   D HRS=YSAO HRS?30
      X*     COLOP*
      X<
    It is telling to move data from TIP to TOP if it is greater than 30 days or else do nothing (dump).
    I am assuming from your reply to edit the rule as
    PTIP   ZHO2 GEN
            D OUTTPVTYPE
          COLOP*
      X    D HRS=YSAO HRS?30
      XX  D HRS=YSAO ADDZL XXXX
      X*     COLOP*
      X<
    What would XXXX mean in ADDZL XXXX.
    and HRS=PNUM GENTPB X what would X mean.
    I am sorry could you elaborate this with an example and give me little explanation.
    appreciate your help.
    Points rewarded for your help.
    Thank you,
    Mamatha

  • Date Difference between to date formula variable

    Hi Expert,
                    I have create two formula variable one for Document Date and another one for Goods reciept date
    and through formula variable I am subtracting these two formula variable and getting the no. of days between
    document date and GR date.
    This Shows me the correct value for one document date because i am filtering my query according to document
    date,
    while i am giving the date range for document date is shows me incorrect result. bucause document date formula
    variable contains only one date.
    Eg. i am giving the document date range like 01.02.2010 - 28.02.2010.
          In document date formula variable it contains only 01.02..2010 and GR date formula variable it contain correct
    value, thats why the date difference is incorrect because those PO which has PO date like 12.02.2010 for that Doc
    formula variable bring the same date like 01.02.2010.
    Please tell me the solution
    Thanks and Regards
    Lalit Kumar

    Hi Expert,
                     Actually i have created two formula variable on for PO date and another for GR date
    and i've restrict the query through PO date.
    while i am taking the single PO date in Selection parameter it showing me correct difference
    eg: Selection Parameter for PO: 01.01.2010
    But while i am taking the date interval for PO date
    eg: 01.01.2010-30.01.2010
    PO No: XXXXX123 , Doc date: 01.01.2010 GR date: 7.01.2010 then date difference is : 6
    PO No: XXXXX432, Doc date: 03.01.2010 GR date: 8.01.2010 then date difference is : 7 but it is 5
    Thanks and Regards
    Lalit Kumar

  • Tables for vendor evaluation data

    Hai,
        I want to know the tables in which vendor evaluation data is being stored, and I need to get vendor evaluation data through my RFC, can u suggest me the procedure how I need to do it.
                                 Thank you
                                  Regards
                                    Srinivas

    Dear,
    You ask a whole Vendor evaluation concept you need to read the help and do customizing depend on the requirement, then you evaluate the vendor using ME61 or ME6G.Almost all of your question need customizing setup first
    below is the guide book :
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/MMISVE/MMISVE.pdf

  • How to get one day back data from selecting date .

    Hi Experts,
                   Iam using DB2 database .How to see one day back of selected date . i tried by using prompts .
    Date=(@prompt('Mssg','D',,mono,free)-1 days)   Date is a date object and i applied prompt for date . butting i'm facing error . so kindly help me to over come this issue .
    Regards
    Dinesh

    first capture Date on univers by simply using your formula
    Date=(@prompt('Mssg','D',,mono,free))
    Now to get the previous date i.e 1 day back date
    create another variable called
    back_Date = (Date - 1 Day)
    Thanks,
    Swapnil

  • Adding Business Days to a formula

    All-
    The formula below is adding a certain number of days to a call date based on dialer result code, but I want to be able to exclude Saturdays and Sundays.... And if it's not too much trouble holidays when adding the days.
    My formula is called @Workdate:
    If {DIALER_IVRCALLDETAIL.IVRDISPID}=106 then {DIALER_IVRCALLDETAIL.CALLSTARTDT}+3
    else
    if {DIALER_IVRCALLDETAIL.IVRDISPID}=105 then {DIALER_IVRCALLDETAIL.CALLSTARTDT}+3
    else
    if {DIALER_IVRCALLDETAIL.IVRDISPID}=90 then {DIALER_IVRCALLDETAIL.CALLSTARTDT}+2
    else
    if {DIALER_IVRCALLDETAIL.IVRDISPID}=91 then {DIALER_IVRCALLDETAIL.CALLSTARTDT}+3
    Else
    if {DIALER_IVRCALLDETAIL.IVRDISPID}=92 then {DIALER_IVRCALLDETAIL.CALLSTARTDT}+2
    I would appreciate any help you can offer!
    Thanks!
    James

    Lets name the existing formula like this
    @DateCalculated:
    If {DIALER_IVRCALLDETAIL.IVRDISPID} in [106,105,91] then ({DIALER_IVRCALLDETAIL.CALLSTARTDT}+3
        - DateDiff("ww", {DIALER_IVRCALLDETAIL.CALLSTARTDT}, {DIALER_IVRCALLDETAIL.CALLSTARTDT}+3, crSaturday)
        - DateDiff("ww", {DIALER_IVRCALLDETAIL.CALLSTARTDT}, {DIALER_IVRCALLDETAIL.CALLSTARTDT}+3, crSunday))
    else
    if {DIALER_IVRCALLDETAIL.IVRDISPID} in [90,92] then ({DIALER_IVRCALLDETAIL.CALLSTARTDT}+2
        - DateDiff("ww", {DIALER_IVRCALLDETAIL.CALLSTARTDT}, {DIALER_IVRCALLDETAIL.CALLSTARTDT}+2, crSaturday)
        - DateDiff("ww", {DIALER_IVRCALLDETAIL.CALLSTARTDT}, {DIALER_IVRCALLDETAIL.CALLSTARTDT}+2, crSunday))
    Now create new formula like this
    if weekday(@DateCalculated)=7 then
    (@DateCalculated)+2
    else if weekday(@DateCalculated)=1 then
    (@DateCalculated)+1
    else
    (@DateCalculated)
    place this in the report which gives the expected date.
    Regards,
    Raghavendra

  • 30 days back data from selected date

    Hi Gurus,
    I have date prompt in a format (02/01/1998(MM/DD/YYYY)12:00:00 AM) and I have report with 4 columns in the 1st column date 2ed column sales 3ed column 30 days back date 4th column 30 days back sales.
    Date | Sales | 30 days Back date(from the selected) | 30 days back Sales
    How i have to take the days from the above format and make that to 30 days back can any one suggest me how to implement this.
    Thanks,
    Rafi

    Hi Svee ,
    I added timestampadd(SQL_TSI_DAY, -30,Date) formula in the Fx of 30 days back column and it is showing 30 days back date but it is not showing 30 days back Sales it is showing same sales for both date columns.
    Thanks,
    Rafi
    Edited by: Rafi.B on Aug 20, 2012 11:48 AM

  • How to group rows based on a formula value

    Hi experts,
    I have a query that returns a a char row (country) and a couple of columns, "Duration of Process in days" and "Counter of nº process done", each a calculated formula KF .
    What I would like is to group the results based on formula KF1 results ""Duration of Process in days".
    For example: from this query result
    Country  -   Duration of Process in Days  -   Counter of nº process done
    ES                      1                                         3
    PT                      3                                         2
    UK                      4                                         3
    IT                       1                                          5
    US                      6                                         2
    FR                      1                                         3
    DE                      4                                         5
    get the following: aggregated by all possible formula values "Duration of Process in Days"
    Duration of Process in Days  -   Counter of nª process
                    1                                       11   (353)
                    3                                         2
                    4                                         8    (3+5)
                    6                                         2
    Is this possible??
    Thanks in advance for your help,
    Best regards,
    Enric

    Hi Vikram,
    my problem is that the "Duration in days" cannot be a characteristic derived in the loading process, as its value depends (is calculated) based on several user's selections done in the variable pop-up screen when executing the report.
    Thanks again for your reply.
    Enric

  • BusinessObjects Integration Kit for SAP u2013 key for 90 day evaluation version

    Hello,
    I have installed Crystal Reports 2008, a 30-Day evaluation version on my laptop, from here:
    http://www.businessobjects.com/campaigns/forms/downloads/crystal/2008/datasave.asp
    and I would like to connect my reports to the SAP Data Source (SAP ECC 6.0). For this I have downloaded the BusinessObjects Integration Kit for SAP - 90 day Evaluation version and I try to install it on my laptop. Unfortunately during the installation of the Integration Kit I receive a message u201CThe product key code is not valid or has expiredu201D. The Product key code and the Integration Kit itself I have taken from this page:
    http://www.sdn.sap.com/irj/boc/index?rid=/webcontent/uuid/806c9894-42a5-2b10-648a-d900489b76da [original link is broken]
    Could you please help me with the installation of this integration kit? What is wrong?

    Hi,
    do you have access to Service Marktplace [http://service.sap.com/support]? You can get the temporary keys for BOBJ under Keys & requests .
    Regards,
    Stratos

  • BO Integration Kit for SAP 90 Days Evaluation

    Question: the BO Integration Kit for SAP 90 Days Evaluation could be installed on Linux? I found this trial on http://www.sdn.sap.com/irj/sdn/index?rid=/webcontent/uuid/806c9894-42a5-2b10-648a-d900489b76da [original link is broken]

    you can download it from the service marketplace
    you will need a cusomter user id
    if you dont have one, you will not be able to login to the service marketplace
    good luck

  • DATE formula bug

    Hello everyone,
    As i said in subject, I have a problem with a DATE formula. It's funny I think but it may be a little problem in the future. My date which should be ok is not. Year and month is ok but day is tricky because I have to put an expression after a DAY (-2). If I don't a date is 2 days later from the one that I want to make. If anybody can help me fix this I really appreciate that.
    Thanks in advance.
    Message was edited by: adpa15

    Is it so tiring to read carefully the available resources ?
    As you may see, Apple took time to give us the needed infos.
    Given what we may read in the forums, it seems that users are more often buggued than the applications themselves
    Yvan KOENIG (VALLAURIS, France) vendredi 19 mars 2010 19:28:43

  • B1DIEventService: Only 90 days evaluation license available

    Hi everybody.
    I am using B1DIEventService and want to get a full license to use it in customer addons. Now I have no idea how to get a full license; the downloaded version is a 90 days evaluation license.
    Additional question to this topic: Do I need a license for each server and each client?
    Can anybody help me?
    Best regards,
    Ralph

    Hi Ralph,
    B1DIEventService is given for free without time limitation. You can deliver it together with your addons, there is no problem.
    The 90 days license is only the general license term given by SDN for all published tools.
    Please don't forget there is no support or responsibility from SAP for the tools published in SDN.
    Best Regards
    Trinidad.

  • The DATA CAP MEGA THREAD....post data cap questions or comments here.

    In the interest of keeping things orderly....This is the DATA CAP MEGA THREAD....post data cap questions or comments here.
    Please keep it civil.
    Comcast is testing usage plans (AKA "data caps") in certain markets.
    The markets that are currently testing usage plans are:
    Nashville, Tennessee market: 300 GB per month and additional gigabytes in increments/blocks ( e.g., $10.00 per 50 GB ). 
    Tucson, Arizona market: Economy Plus through Performance tiers receive 300 GB. Those customers subscribed to the Blast! Internet tier receive 350 GB; Extreme 50 customers receive 450 GB; Extreme 105 customers receive 600 GB. Additional gigabytes in increments/blocks of 50 GB for $10.00 each in the event the customer exceeds their included data amount. 
    Huntsville and Mobile, Alabama; Atlanta, Augusta and Savannah, Georgia; Central Kentucky; Maine; Jackson, Mississippi; Knoxville and Memphis, Tennessee and Charleston, South Carolina: 300 GB per month and additional gigabytes in increments/blocks ( e.g., $10.00 per 50 GB ) Economy Plus customers have the option of enrolling in the Flexible-Data plan.
    Fresno, California, Economy Plus customers also have the option of enrolling in the Flexible-Data plan.
    - If you live outside of these markets you ARE NOT currently subject to a data plan.
    - Comcast DOES NOT THROTTLE your speed if you exceed your usage limits.
    - You can check out the Data Usage Plan FAQ for more information.
     

    I just got a call today that I reached my 300GB limit for the month.  I called and got a pretty rude response from the security and data usage department.  The guy told me in so many words that if I do not like or agree with the policy that I should feel free to find another service provider.!!! I tried to explain that we watch Netflix and XFinity on-demand alot and I was told that that can not be anywhere close to the data usage. I checked my router and watching a "super HD, dolby 5.1" TV show on Netflix will average about 5-6 GB per hour (1.6MB/s) ... sp this means that I can only watch no more than 1-2 Super HD TV shows a day via Netflix before I run out of my data usage.    This seems a bit redicilous doesn't it? Maybe the TV ads about the higher speed than the competition should be accompanied with "as long as you don't use it too often"   Not a good experience ... 

Maybe you are looking for

  • Class name and package name clashing

    When i have a class and a package with the same name, I cannot access classes in the package. For example I have 3 classes and 1 package as below - Test.java - PackageName.java + PackageName // this is a directory - MyClass.java Below are the codes o

  • SBS 2011 RWA "Connect" Button randomly stop working

    I have an SBS 2011 Standard Server that recently has had problems with its RWA site.  Periodically, the "Connect" buttons on the RWA Page for workstations simply stops working.  You can not establish a remote desktop connection via the site to workst

  • Querty keyboard on apple tv france

    Hello Apple ! I have an Apple blue tooth keybord, french AZERTY and Apple TV with last update ( very long update...) so my Apple TV link this keyboard , but on QUERTY mode What's append ?  Apple don't test this function ? fantastic .... please send m

  • HR record replication issue

    Hi Experts, We have a few user's who are on Higher Duty and for these persons in table HRP1001 in SRM shows all the entries but when we try to view it in the Org plan it doesn't appear anywhere. I know we can pfal the person, but i would like to know

  • Dots are appearing on characters after created PDF through *.dwg file using AutoVue API

    Hi,    I created PDF's through *.dwg file using AutoVue API 20.2.2. I observed in more zoom of PDF, every character or line has dots. At the same time on second page of PDF drawing lines are thicker that first page of PDF.    Please kindly help on th