Quarter,half yaer reports

Hi,
I have few requirement like
<b>QUARTE1,HALFYEAR1,9ONTHSFY07,YTDJAN07,YTDFEB07</b>--- THESE ALL IN COULNMS AND BY GIVING ONE SINGLE VARIABLE INPUT WHILE RUNNING A QUERY,
CAN ANY PLS HELP OUT FROM THIS PROB
REGARDS,

Swapna,
THerer are two of doing that. One is searching for SAP variable on the required IO and second is using your own by the way of customer exits.
First, I recommend you to search for the SAP variables on that particular IO and if they meet your requirement it okay. Else you need to go for customer exits to fulfil you requirement.
Let me know the next step.

Similar Messages

  • Quarter/Jahr in Report

    Hi experts
    by building some reports i get some difficulties.
    I wanted to build reports with previous und current quarter.
    I could see the previous quarter in teh activated elements. So i take the curent Quarter and i set up an offset with -1 to build a previous quarter.
    Ich wanted in each column the appropriate quarter to appear. I try to select a text varaible but didnt succeed.
    Can anyone help me to do that?
    Thanks
    Gilo

    Hi Wond,
    thank you for the advice.
    I know how i can creta a text variable.
    I try to describe again.
    Q1 2007, Q2 2007, Q3 2007, Q4 2007, Q1 2008, Q2 2008 my report have to be like this.
    I have no text varibale for Quartal.
    In the system there is a text varibale for year. I can not activate again the content .i could i implement that?
    Thank for your help.
    Gilo

  • Bug in Flash? Mono sounds can't seek past first half (and report sound.length wrong)

    I'm working on an mp3 player in AS3 and I just discovered
    what appears to be a bug in the Sound class when loading mono
    mp3's. The "length" property is reported as twice the actual length
    while the file loads. The moment it's complete, the length property
    snaps to the correct value.
    Also, even after the file is completely loaded, it is
    impossible to seek to anywhere past the halfway point of the audio.
    This means that if a user "pauses" the audio and then hits the play
    button again (anywhere in the second half of the file), it won't
    actually play.
    I found a post about this from someone on this forum back in
    2005, but it doesn't seem to be resolved. I've been specifically
    testing 22khz mono mp3's. 44khz stereo ones work fine, so my guess
    is that it has something to do with Mono.
    Can anyone help? I can post examples and source code if
    necessary. Thank you! --Ben

    I'm banging my head because I can't find a solution to make my arch-install detect an audio CD
    I assume that you mean the optical drive. I don't see a /dev/sr0 in /dev
    Does it show up with lsblk or parted -l?
    Looks like it's a LiteOn drive.
    You can play an audio CD.
    mplayer cdda://
    mpv cdda://track[−endtrack][:speed][/device] −−cdrom−device=PATH
    An audio CD doesn't have a mountable file system on it.

  • Using fiscal period and Fiscal quarter reporting seemlessly in a BI Query

    Hi,
    We have a very specific issue. Reporting the Fiscal Period( in our
    case we have 53 fiscal periods) and Fiscal Quarter( we have 4 quarters)
    in the same query seamlessly as we would have done using Calander Month
    and Calander quarter in other reports that uses SAP delivered standard
    time dimensions.
    However unlike the Calander time dimension (SAP provided all
    possible...0CALDAY, 0CALWEEK, 0CALMONTH, 0CALQUARTER, 0CALYEAR) where you have all of these inside your info provider, you can get
    aggregation on week, month, quarter etc in your query seamlessly, The Fiscal Year/Period offers a problem in doing report seamlessly.
    When we delve into Fiscal realm, SAP only provided with 0FISCVARNT,
    0FISCPER, 0FISCYEAR and a special period 0FISCPER3. It doesn't provide
    anything like 0FISCQUARTER etc and rightly so, because you can have
    only one 0FISCVARNT in the Time dimension and can have related periods
    (0FISCPER) only for a Row of data in your infocube. For example if you need to model as per the Fiscalweek, you can create a custom Fiscal year variant (Say z1) and can configure to have only 53 periods (Mapped to 0FISCPER) representing
    53 Fiscal WEEK. Similarly for mapping Fiscal Quarter you can create
    another fiscal year variant (Say Z2) and have only 4 periods (mapped to
    0FISCPER also in this case) to represent the 4 Fiscal Quarter. However
    the issue is that for one record you can only map either of those and
    not both since you can only have one Fiscal year variant in one row of
    data in the info provider.
    For example
    If I have two rows OF DATA coming from different sources (One FOR
    Fiscal Week and another for Fiscal Quarter) I can have the following in
    my info provider.
    1> Example data in Fiscal
    Char1 Char2 0CALDAY 0FISCVARNT 0FISCPER Quantity
    X  ......  y .....10/22/07 ....Z1 ....           43’2007 .......10
    X .......  Y .....10/22/07 ....Z2 ....          Q3’2007 .......20
    The issue is how do I report the Quantity in a query in Quarter Q3 as
    (10 + 20 = 30) since both the rows corresponds to FISCAL Q3’2007?
    (Please note that Fiscal week 43’2007(For VARIANT Z1 ) actually is
    Fiscal Quarter Q3’2007( For Fiscal Variant Z2) as per our
    configuration of Fiscal Year Variant configuration Z1 and Z2)
    The same is very simple when I have infoprovider with CALENDAR Time
    dimensions , for example if we don’t have any fiscal reporting
    requirement and just report on calendar time dimension the record in
    the info provider would look like the following ( example)
    2> Example Data in CALENDAR DIMENSION
    Char1 Char2 0CALDAY 0CALWEEK 0CALQUARTER Quantity
    X ........ y .......10/22/07 .......43’2007 .......Q3’2007 .......10
    X ........Y .......10/22/07 ....... 44’2007 .......Q3’2007 .......20
    Here we can use both 0CALQUARTER and get the data aggregated on the
    quarter level in addition to the 0CALWEEK.
    To solve this issue, One option that we are thinking of Using 0CALQUARTER to represent the
    Fiscal Quarter and use Update rule to populate this one. For example
    THE example 1 can be as follows.
    1A> Example of using 0CALQUARTER along with 0FISCVARNT and 0FISCPER
    Char1 Char2 0CALDAY 0FISCVARNT 0FISCPER 0CALQUARTERE Quantity
    X .......y .......10/22/07 ..............Z1 .......43’2007 .......Q3’2007 ..............10
    X .......Y .......10/22/07 ..............Z2 .......Q3’2007 .......Q3’2007 ..............20
    In this case we would populate the 0CALQUARTER by the actual Fiscal
    Quarter and then can use both as per example 2 above. But this is not a
    smooth option since we have various other info providers to join and
    report based on solely Fiscal Quarter etc…
    I am certain that this issue have already been solved by somebody as this bound to happen in any finance application.
    Would appreciate if we can get some light on this regarding the data modelling, reporting etc.
    Thanks
    Arun G.

    You have yourself suggested a solution, which is fine,
    Other option is to have a new characteristic Fiscal Qtr in all the infoproviders ans update the same using a routine in the updaterule depending on the fiscal year variant.
    for eg. for transaction with variant Z1 in one case you can say if fiscal week 01 between 01 to 13 the Fiscal Qtr should be update with1 and if it is between 14 to 26 then update fiscal qtr with 2 and so on.
    For other Variants Z2 you write a different login in the routine ans so on.
    so for all the data irrespective of the variant you will have the qtr as either 1 or 2 or 3 or 4 and you can report on this fiscal qtr.
    assign points if it helps.
    regards
    Venkata Devaraj

  • Half of clients report: MP has rejected registration request due to failure in client certificate

    My entire site is configured to use HTTPS, about half my clients have installed and continue to communicate with the MP successfully whereas the other half are reporting the following error during installation:
    MP has rejected registration request due to failure in client certificate (Subject Name: COMPUTER.DOMAIN.COM) chain validation. If this is a valid client, Configuration Manager Administrator needs to place the Root Certification Authority and Intermediate
    Certificate Authorities in the MPÆs Certificate store or configure Trusted Root Certification Authorities in primary site settings. The operating system reported error 2148204809: A certificate chain processed, but terminated in a root certificate which is
    not trusted by the trust provider. 
    The thing is, ALL clients have the same Root Certification Authority and Intermediate Certificate Authorities, any thoughts?

    Hi,
    Is possible that half of your clients are enrroll in your PKI infrastruture with a root certificate old of you Certificate authority and you only have one certifiacate register un the SCCM, you can't have 2 root certificate with the same subject but you
    can re-enrroll all your client machine if have auto-enrroll configured by GPO's.
    I will Attach 2 snapshot's that can help to identify if you root ca certificate in SCCM are correct and are the same that the certificate root authority in you client certificate, if you like re-enrroll all your machine to ensure that all clients machine
    have the same root ca you can see how in this link
    http://windowsitpro.com/security/q-there-easy-way-automatically-re-enroll-certificate-holders-received-certificate-old-ca-ne
    Client Side

  • Dynamic reporting, time dependent columns

    Hello,
    We are trying to make some dynamic reports, for example with the columns: the last six months , quarter, current year, last year etc etc (a half year report). Is it possible to give in a year\period which is the "current period", so that all dynamic (time) columns are relative from this date. This because it is not known in which month the work is done (and the cubes updated) and the reports are run.
    Regards.

    If so,.....
    1)create a variable on Time Char (instead the Business Content Variable) with manual input mandatory
    2)insert an 'OFFSET'
    For example:
    a) create a variable on calmonth
    b) create a new selection in column
    __b.1) insert your KF in selection
    __b.2) insert new variable of calmonth in selection
    __b.3) change offset of variable, i.e. for six month write -6
    Hope it helps!
    C@f
    How to give points: Mark your thread as a question while creating it. In the answers you get, you can assign the points by clicking on the stars to the left.

  • [nQSError: 22036] Level in TODATE function (Quarter) must be a rollup...

    Hi,
    i've following problem. I hope you can help. It's quite urgent.
    I have following TimeDim hierarchy, in my rpd:
    Logical Level: Total Time - Properties: Grand Total Level
    Child Logical Level: Year - Properties: Supports rollup to higher level of aggregation - Keys: Year Code (Cronological Key) - Logical Column: Year Code, Year Description
    Child Logical Level: Semester - Properties: Supports rollup to higher level of aggregation - Keys: Semester Code (Cronological Key) - Logical Column: Semester Code, Semester Description
    Child Logical Level: Quarter - Properties: Supports rollup to higher level of aggregation - Keys: Quarter Code (Cronological Key) - Logical Column: Quarter Code, Quarter Description
    Child Logical Level: Time Detail - Properties: Supports rollup to higher level of aggregation - Keys: TTPER (Cronological Key) - Logical Column: Desc Month, TTPER, Desc Month Short
    Then, i've defined my measures using TODATE Function:
    - Net Number of HA Units delivered Monthly
    - Net Number of HA Units delivered Qtd = TODATE("Net Number of HA Units delivered Monthly", "TimeDim"."Quarter")
    - Net Number of HA Units delivered Ytd = TODATE("Net Number of HA Units delivered Monthly", "TimeDim"."Year")
    - Ha Returned Quantity Monthly
    - Ha Returned Quantity Qtd = TODATE("Ha Returned Quantity Monthly", "TimeDim","Quarter")
    - Ha Returned Quantity Ytd = TODATE("Ha Returned Quantity Monthly", "TimeDim","Year)
    In my Report i've following columns:
    HA Deliveries Quantity Gross QTD: fx = Net Number of Ha Units delivered Qtd + Ha Returned Quantity Qtd
    HA Deliveries Quantity Gross YTD: fx = Net Number of Ha Units delivered Ytd + Ha Returned Quantity Ytd
    Column HA Deliveries Quantity Gross Ytd works. For first column i have following error:
    [nQSError: 22036] Level in TODATE function (Quarter) must be a rollup of (or equivalent to) the measure level (Year).
    Why?
    If i modify first column fx dropping sum, but selecting first or second addend separately it works. Sum not
    For example: HA Deliveries Quantity Gross Qtd: fx = Net Number of HA Units delivered Qtd OK
    or
    HA Deliveries Quantity Gross Qtd: fx = HA Returned Quantity Qtd OK
    Maybe there's something wrong in my hierarchy definition?. Please help
    Giancarlo

    Giancarlo,
    Can you try adding prersentation column "TimeDim"."Quarter" to your report and check ? Hide it if you don't require it. This shud solve your problem as the Time Hierarchy is defined correctly. Also, hope you have set the Chronological Key correctly at the last level.

  • Sales voluem monthly wise report

    Hi BW expert,
    I need a repor like apr09,may09,june09 Q1, apr08,may08,june08 Q1 LY. but i restricted apr, may june on posting period its displaying only q1 . i need monthly wise like apr08,may08,june08.i searced this forum as per requirement its not displaying plz any one idea on this how to get montly wise .
    Regards
    ramakrishna

    Hi
    Yes, it is possible to compare the sales for two different periods (be it date, month, quarter, half-year, full year, etc.).   I used the fields "Calendar Year /Month period 1" and "Calendar Year /Month period 2" and also added a formula to show the growth in terms of percentages.    And it is working well in my company.
    In fact I designed the query in the following way:-
    1.   Month - (single month - say Sept. 2009)
    2.   Month - (single month - say Sept. 2008)
    3.  Months - (Jan/Sept. 2009)
    4.    Months - (Jan/Sept. 2008).
    In the query I have made a comparison of sales, ie. sales of Sept. 2009 compared to Sept. 2008 and Sales of Jan/Sept. 2009 compared to Jan/Sept. 2008.   
    All the above done in a single query.
    Regards
    Jayan
    Bangalore, India

  • Quarter Vs week data difference

    Hi,
    I am running two reports:
    1st report - It is based on the 2nd Quarter of the year.
                     means it is restricted by using 2nd quarter.
    2nd report - It is same as 1st report, except that it is based on the 12 weeks which constitute that qtr.
    so therotically the output of both the reports should be same.
    because the selection criteron of both is same
    But the output of the reports are different ...
    Howz it possible..please help me out..its quite urgent....

    Himashu,
                  Are the both queries based on the same infoprovider, if they are the best way to check is pull the 0calweek into your 1st query free characteristic and run the report for the 2nd quarter and drill it down by the 0calweek in rows, compare this report with your 2nd report, check for the global filters and restrictions in two reports, check whether they are same or different.
    *assign points if helpful**
    Peter R

  • Display Current Quarter and Previous Quarter???

    Hi Gurus,
    I Had a requirement to display only the current Quarter and previous quarter in the report level using single quarter column.
    and my quarter value type is Q1 2013.
    Please anyone help me out on this asap/
    Thanks.

    Hi,
    Using time serious function you can acheive this requirement.
    http://obieetutorialguide.blogspot.in/2012/02/modeling-time-series-function-in-obiee.html
    OBIEE 11g Time Series Function
    or,
    Using presentation variable you can achieve this.
    Re: OBIEE 10g LY YTD returns YTD for past years
    The above thread for year you can change to qtr.
    Hope this help's
    Thanks,
    Satya

  • Regarding identification of calyear/ quarter with zquarter

    Hello Guru's,
    I have query on Multiprovider which reports according to the given calyear/quarter. I had to add a infoset to existing multiprovider, so that i can include a new selection in the same report. My problem is there is no calyear/quarter in the infoset. While identification can i select Zquarter under cal year/quarter. By doing this when ever use calyear/quarter in my report for the newfield, do i get union calyear quarter and Zquarter, or there will be error in the report since both are not cal year/quartet

    Are you adding Zquarter to an infoprovider in the infoset ?
    Is there any reason y you cant add calyear/quarter into one of the infoproviders in your infoset.  and map it to the date you want calyear/quarter on.  You can use one of the standard formula to calculate it.

  • Call Type Half Hour - Aggregated over days

    I am looking for suggestions on Call Type Half Hour report (calltyp22 in webview).
    We need a custom version where the half hours stats are for the entire interval not by each day.
    Is there a canned report for this in 7.5 Webview? is this something one can do with CUIS/CUIC?
    In terms of SQL I could do some group by basedon time - but would appreciate any hints.
    Thanks.

    There's nothing out of the box that will do that. I've built those type of reports as custom reports before for webview so I would say you'd have to look at doing it in SQL (from memory I did it by casting DateTime to a string, doing a RIGHT string function on it to grab just the time and then grouping by that).
    In CUIS you'll run across the same issue, you'll be able to group by day if required out of the box but to aggregate for a 30 minute interval over a period of days that will need to be done using modified SQL just the same.
    Cheers,
    Nathan

  • Cuic report template - perskg22

    I would like to have an report for skillgroup as the customer requirement refer to the
    perskg22 - icm peripheral skill group task summary daily.
    I do have the skill group interval, but i could not able generate the report for consolidated output. Even i tried from web view query it is providing the half hour report not consolidated.
    Please help me to have the template or advise me how to generate.
    with Regards,
    Manivannan

    Hi Gergely,
    Thanks for the input, i have tried to replace the Interval-SGHH.DateTime with suggest CAST command, but it showing always some error, could you help me modify the below Query it would be grateful to you.
    SELECT
    Interval = SGHH.DateTime,
    Datepart(yy, SGHH.DateTime) as Year, Datepart(mm, SGHH.DateTime) as Month,
    Datepart(ww, SGHH.DateTime) as Week,
    Datepart(dy, SGHH.DateTime) as DOY,
    Datepart(dw, SGHH.DateTime) as DOW,
    CONVERT(char(10),SGHH.DateTime,101) as DATE,
    FullName = Skill_Group.EnterpriseName,
    SkillGroupSkillID = Skill_Group.SkillTargetID,
    CallbackMessages = SUM(ISNULL(SGHH.CallbackMessages, 0)),
    CallbackMessagesTime = SUM(ISNULL(SGHH.CallbackMessagesTime, 0)),
    AvgHandledCallsTalkTime = SUM(ISNULL(SGHH.AvgHandledCallsTalkTime, 0)),
    HoldTime = SUM(ISNULL(SGHH.HoldTime, 0)),
    HandledCallsTalkTime = SUM(ISNULL(SGHH.HandledCallsTalkTime, 0)),
    InternalCalls = SUM(ISNULL(SGHH.InternalCalls, 0)),
    InternalCallsTime = SUM(ISNULL(SGHH.InternalCallsTime, 0)),
    CallsHandled = SUM(ISNULL(SGHH.CallsHandled, 0)),
    SupervAssistCalls= SUM(ISNULL(SGHH.SupervAssistCalls, 0)),
    AvgHandledCallsTime = SUM(ISNULL(SGHH.AvgHandledCallsTime, 0)),
    SupervAssistCallsTime = SUM(ISNULL(SGHH.SupervAssistCallsTime, 0)),
    HandledCallsTime = SUM(ISNULL(SGHH.HandledCallsTime, 0)),
    PercentUtilization = SUM(ISNULL(SGHH.PercentUtilization, 0)),
    AgentOutCallsTime = SUM(ISNULL(SGHH.AgentOutCallsTime, 0)),
    TalkInTime = SUM(ISNULL(SGHH.TalkInTime, 0)),
    LoggedOnTime = SUM(ISNULL(SGHH.LoggedOnTime, 0)),
    ExternalOut = SUM(ISNULL(SGHH.AgentOutCalls, 0)),
    TalkOutTime = SUM(ISNULL(SGHH.TalkOutTime, 0)),
    TalkOtherTime = SUM(ISNULL(SGHH.TalkOtherTime, 0)),
    AvailTime = SUM(ISNULL(SGHH.AvailTime, 0)),
    NotReadyTime = SUM(ISNULL(SGHH.NotReadyTime, 0)),
    TransferInCalls = SUM(ISNULL(SGHH.TransferInCalls, 0)),
    TalkTime = SUM(ISNULL(SGHH.TalkTime, 0)),
    TransferInCallsTime = SUM(ISNULL(SGHH.TransferInCallsTime, 0)),
    WorkReadyTime = SUM(ISNULL(SGHH.WorkReadyTime, 0)),
    TransferOutCalls = SUM(ISNULL(SGHH.TransferOutCalls, 0)),
    WorkNotReadyTime = SUM(ISNULL(SGHH.WorkNotReadyTime, 0)),
    RecoveryDay = SUM(ISNULL(SGHH.RecoveryDay, 0)), BusyOtherTime = SUM(ISNULL(SGHH.BusyOtherTime, 0)),
    CallsAnswered = SUM(ISNULL(SGHH.CallsAnswered, 0)),
    ReservedStateTime = SUM(ISNULL(SGHH.ReservedStateTime, 0)),
    AnswerWaitTime = SUM(ISNULL(SGHH.AnswerWaitTime, 0)),
    AbandonRingCalls = SUM(ISNULL(SGHH.AbandonRingCalls, 0)),
    AbandonRingTime = SUM(ISNULL(SGHH.AbandonRingTime, 0)),
    AbandonHoldCalls = SUM(ISNULL(SGHH.AbandonHoldCalls, 0)),
    AgentOutCallsTalkTime = SUM(ISNULL(SGHH.AgentOutCallsTalkTime, 0)),
    AgentOutCallsOnHold = SUM(ISNULL(SGHH.AgentOutCallsOnHold, 0)),
    AgentOutCallsOnHoldTime = SUM(ISNULL(SGHH.AgentOutCallsOnHoldTime, 0)),
    AgentTerminatedCalls = SUM(ISNULL(SGHH.AgentTerminatedCalls, 0)),
    ConsultativeCalls = SUM(ISNULL(SGHH.ConsultativeCalls, 0)),
    ConsultativeCallsTime = SUM(ISNULL(SGHH.ConsultativeCallsTime, 0)),
    ConferencedInCalls = SUM(ISNULL(SGHH.ConferencedInCalls, 0)),
    ConferencedInCallsTime = SUM(ISNULL(SGHH.ConferencedInCallsTime, 0)),
    ConferencedOutCalls = SUM(ISNULL(SGHH.ConferencedOutCalls, 0)),
    ConferencedOutCallsTime = SUM(ISNULL(SGHH.ConferencedOutCallsTime, 0)),
    IncomingCallsOnHoldTime = SUM(ISNULL(SGHH.IncomingCallsOnHoldTime, 0)),
    IncomingCallsOnHold = SUM(ISNULL(SGHH.IncomingCallsOnHold, 0)),
    InternalCallsOnHoldTime =SUM(ISNULL(SGHH.InternalCallsOnHoldTime, 0)),
    InternalCallsOnHold = SUM(ISNULL(SGHH.InternalCallsOnHold, 0)),
    InternalCallsRcvdTime = SUM(ISNULL(SGHH.InternalCallsRcvdTime, 0)),
    InternalCallsRcvd = SUM(ISNULL(SGHH.InternalCallsRcvd, 0)),
    RedirectNoAnsCalls = SUM(ISNULL(SGHH.RedirectNoAnsCalls, 0)),
    RedirectNoAnsCallsTime = SUM(ISNULL(SGHH.RedirectNoAnsCallsTime, 0)),
    ShortCalls = SUM(ISNULL(SGHH.ShortCalls, 0)),
    RouterCallsAbandQ = SUM(ISNULL(SGHH.RouterCallsAbandQ, 0)),
    RouterQueueCalls = SUM(ISNULL(SGHH.RouterQueueCalls, 0)),
    AutoOutCalls = SUM(ISNULL(SGHH.AutoOutCalls, 0)),
    AutoOutCallsTime = SUM(ISNULL(SGHH.AutoOutCallsTime, 0)),
    AutoOutCallsTalkTime = SUM(ISNULL(SGHH.AutoOutCallsTalkTime, 0)),
    AutoOutCallsOnHold = SUM(ISNULL(SGHH.AutoOutCallsOnHold, 0)),
    AutoOutCallsOnHoldTime = SUM(ISNULL(SGHH.AutoOutCallsOnHoldTime, 0)),
    PreviewCalls = SUM(ISNULL(SGHH.PreviewCalls, 0)),
    PreviewCallsTime = SUM(ISNULL(SGHH.PreviewCallsTime, 0)),
    PreviewCallsTalkTime = SUM(ISNULL(SGHH.PreviewCallsTalkTime, 0)),
    PreviewCallsOnHold = SUM(ISNULL(SGHH.PreviewCallsOnHold, 0)),
    PreviewCallsOnHoldTime = SUM(ISNULL(SGHH.PreviewCallsOnHoldTime, 0)),
    ReserveCalls = SUM(ISNULL(SGHH.ReserveCalls, 0)),
    ReserveCallsTime = SUM(ISNULL(SGHH.ReserveCallsTime, 0)),
    ReserveCallsTalkTime = SUM(ISNULL(SGHH.ReserveCallsTalkTime, 0)),
    ReserveCallsOnHold = SUM(ISNULL(SGHH.ReserveCallsOnHold, 0)),
    ReserveCallsOnHoldTime = SUM(ISNULL(SGHH.ReserveCallsOnHoldTime, 0)),
    TalkAutoOutTime = SUM(ISNULL(SGHH.TalkAutoOutTime, 0)),
    TalkPreviewTime = SUM(ISNULL(SGHH.TalkPreviewTime, 0)),
    TalkReserveTime = SUM(ISNULL(SGHH.TalkReserveTime, 0)),
    BargeInCalls = SUM(ISNULL(SGHH.BargeInCalls, 0)),
    InterceptCalls = SUM(ISNULL(SGHH.InterceptCalls, 0)),
    MonitorCalls = SUM(ISNULL(SGHH.MonitorCalls, 0)),
    WhisperCalls = SUM(ISNULL(SGHH.WhisperCalls, 0)),
    EmergencyAssists = SUM(ISNULL(SGHH.EmergencyAssists, 0)),
    CallsOffered = SUM(ISNULL(SGHH.CallsHandled, 0)) + SUM(ISNULL(SGHH.RouterCallsAbandQ, 0)) + SUM(ISNULL(SGHH.AbandonRingCalls, 0))+ SUM(ISNULL(SGHH.RedirectNoAnsCalls, 0)),
    CallsQueued = SUM(ISNULL(SGHH.RouterQueueCalls, 0)),
    InterruptedTime = SUM(ISNULL(SGHH.InterruptedTime, 0)),
    RecoveryKey = SGHH.RecoveryKey,
    TimeZone = SGHH.TimeZone,
    RouterCallsOffered=SUM(ISNULL(SGHH.RouterCallsOffered,  0)), 
    RouterCallsAgentAbandons = SUM(ISNULL(SGHH.RouterCallsAbandToAgent, 0)),  
    RouterCallsDequeued = SUM(ISNULL(SGHH.RouterCallsDequeued, 0)),  
    RouterError=SUM(ISNULL(SGHH.RouterError,  0)), 
    ServiceLevel=SUM(ISNULL(SGHH.ServiceLevel,  0)), 
    ServiceLevelCalls=SUM(ISNULL(SGHH.ServiceLevelCalls, 0)),  
    ServiceLevelCallsAband= SUM(ISNULL(SGHH.ServiceLevelCallsAband,  0)), 
    ServiceLevelCallsDequeue=SUM(ISNULL(SGHH.ServiceLevelCallsDequeue,  0)), 
    ServiceLevelError=  SUM(ISNULL(SGHH.ServiceLevelError, 0)),  
    ServiceLevelRONA=SUM(ISNULL(SGHH.ServiceLevelRONA, 0)),  
    ServiceLevelCallsOffered= SUM(ISNULL(SGHH.ServiceLevelCallsOffered,0)),
    NetConsultativeCalls = sum(isnull(SGHH.NetConsultativeCalls,   0)),
    NetConsultativeCallsTime=SUM(ISNULL(SGHH.NetConsultativeCallsTime, 0)),
    NetConferencedOutCalls=sum(isnull( SGHH.NetConferencedOutCalls, 0)),
    NetConfOutCallsTime=SUM(ISNULL(SGHH.NetConfOutCallsTime, 0)),
    NetTransferredOutCalls = sum(isnull(SGHH.NetTransferOutCalls, 0)),
    DbDateTime = SGHH.DbDateTime,
    fte_AgentsLogonTotal=SUM(ISNULL(SGHH.LoggedOnTime,0)) * 1.0 / 1800,  
    fte_AgentsNotReady=SUM(ISNULL(SGHH.NotReadyTime,0)) * 1.0 / 1800,  
    fte_AgentsNotActive=SUM(ISNULL(SGHH.AvailTime,0)) * 1.0 / 1800,  
    fte_AgentsActive=SUM(ISNULL(SGHH.TalkTime,0)) * 1.0 / 1800,
    fte_AgentsWrapup=SUM(ISNULL(SGHH.WorkReadyTime, 0)+ISNULL(SGHH.WorkNotReadyTime, 0)) * 1.0 / 1800,  
    fte_AgentsOther=SUM(ISNULL(SGHH.BusyOtherTime,0)) * 1.0 / 1800,  
    fte_AgentsHold=SUM(ISNULL(SGHH.HoldTime,0)) * 1.0 / 1800,  
    fte_AgentsReserved=SUM(ISNULL(SGHH.ReservedStateTime,0)) * 1.0 / 1800 ,
    ast_PercentNotActiveTime= (CASE WHEN SUM(ISNULL(SGHH.LoggedOnTime,0)) = 0 THEN 0
           ELSE SUM(ISNULL(SGHH.AvailTime,0)) * 1.0 / SUM(ISNULL(SGHH.LoggedOnTime,0)) END),
    ast_PercentActiveTime= (CASE WHEN SUM(ISNULL(SGHH.LoggedOnTime,0)) = 0 THEN 0
           ELSE SUM(ISNULL(SGHH.TalkTime,0)) * 1.0 / SUM(ISNULL(SGHH.LoggedOnTime,0)) END),
    ast_PercentHoldTime= (CASE WHEN SUM(ISNULL(SGHH.LoggedOnTime,0)) = 0 THEN 0
           ELSE SUM(ISNULL(SGHH.HoldTime,0)) * 1.0 / SUM(ISNULL(SGHH.LoggedOnTime,0)) END),
    ast_PercentWrapTime= (CASE WHEN SUM(ISNULL(SGHH.LoggedOnTime,0)) = 0 THEN 0
           ELSE (SUM(ISNULL(SGHH.WorkNotReadyTime + SGHH.WorkReadyTime, 0))) * 1.0 / SUM(ISNULL(SGHH.LoggedOnTime,0)) END),
    ast_PercentReservedTime= (CASE WHEN SUM(ISNULL(SGHH.LoggedOnTime,0)) = 0 THEN 0
           ELSE SUM(ISNULL(SGHH.ReservedStateTime,0)) * 1.0 / SUM(ISNULL(SGHH.LoggedOnTime,0)) END),
    ast_PercentNotReadyTime= (CASE WHEN SUM(ISNULL(SGHH.LoggedOnTime,0)) = 0 THEN 0
           ELSE SUM(ISNULL(SGHH.NotReadyTime,0)) * 1.0 / SUM(ISNULL(SGHH.LoggedOnTime,0)) END),
    ast_PercentUtilization=
    CASE WHEN SUM(ISNULL(SGHH.TalkTime, 0)) = 0 THEN 0
      ELSE ISNULL((SUM(ISNULL(SGHH.TalkInTime, 0)) +
           SUM(ISNULL(SGHH.TalkOutTime, 0)) +
           SUM(ISNULL(SGHH.TalkOtherTime,  0)) +
           SUM(ISNULL(SGHH.WorkReadyTime, 0)) +
           SUM(ISNULL(SGHH.WorkNotReadyTime, 0))) * 1.0 /
            (SUM(ISNULL(SGHH.LoggedOnTime, 0)) - SUM(ISNULL(SGHH.NotReadyTime, 0))), 0)
      END,
    asa=  ISNULL(SUM(ISNULL(SGHH.AnswerWaitTime,0)) * 1.0 / SUM(ISNULL(SGHH.CallsAnswered,0)),0),
    CompletedTasks_AHT =  (CASE WHEN SUM(ISNULL(SGHH.CallsHandled,0)) = 0 THEN 0
           ELSE SUM(ISNULL(SGHH.HandledCallsTime,0)) / SUM(ISNULL(SGHH.CallsHandled,0)) END),
    CompletedTasks_AvgActiveTime=ISNULL((SUM(ISNULL(SGHH.HandledCallsTalkTime, 0)) / SUM(ISNULL(SGHH.CallsHandled, 0))), 0),
    CompletedTasks_AvgWrapTime=ISNULL(((SUM(ISNULL(SGHH.HandledCallsTime, 0)) - SUM(ISNULL(SGHH.HandledCallsTalkTime,0)) - SUM(ISNULL(SGHH.IncomingCallsOnHoldTime, 0))) / SUM(ISNULL(SGHH.CallsHandled,0))), 0),
    ast_ActiveTime = SUM(ISNULL(SGHH.TalkTime, 0)),
    TotalQueued = SUM(ISNULL(SGHH.RouterQueueCalls, 0)) + SUM(ISNULL(SGHH.CallsQueued, 0)),
    ast_PerBusyOtherTime = (CASE WHEN SUM(ISNULL(SGHH.LoggedOnTime,0)) = 0 THEN 0
           ELSE SUM(ISNULL(SGHH.BusyOtherTime,0)) * 1.0 / SUM(ISNULL(SGHH.LoggedOnTime,0)) END),
    Media= Media_Routing_Domain.EnterpriseName,
    AbandCalls = SUM(ISNULL(SGHH.AbandonRingCalls, 0)) + SUM(ISNULL(SGHH.RouterCallsAbandQ, 0)),
    RouterMaxCallsQueued=sum(SGHH.RouterMaxCallsQueued),
    RouterMaxCallWaitTime=sum(SGHH.RouterMaxCallWaitTime)
    FROM Skill_Group (nolock), Skill_Group_Interval SGHH (nolock), Media_Routing_Domain (nolock) 
    WHERE ( Skill_Group.SkillTargetID = SGHH.SkillTargetID ) and 
             ( Skill_Group.MRDomainID = Media_Routing_Domain.MRDomainID )   
    GROUP BY
    Skill_Group.EnterpriseName,  
    Skill_Group.SkillTargetID,
    Media_Routing_Domain.EnterpriseName,
    SGHH.DateTime,
    Datepart(yy, SGHH.DateTime),
    Datepart(mm, SGHH.DateTime),
    Datepart(ww, SGHH.DateTime),
    Datepart(dy, SGHH.DateTime),
    Datepart(dw, SGHH.DateTime),
    CONVERT(char(10),SGHH.DateTime,101),
    SGHH.RecoveryKey,
    SGHH.TimeZone,
    SGHH.DbDateTime
    ORDER BY  Media_Routing_Domain.EnterpriseName ,Skill_Group.EnterpriseName, SGHH.DateTime
    SELECT
    Interval = SGHH.DateTime,
    Datepart(yy, SGHH.DateTime) as Year, Datepart(mm, SGHH.DateTime) as Month,
    Datepart(ww, SGHH.DateTime) as Week,
    Datepart(dy, SGHH.DateTime) as DOY,
    Datepart(dw, SGHH.DateTime) as DOW,
    CONVERT(char(10),SGHH.DateTime,101) as DATE,
    FullName = Skill_Group.EnterpriseName,
    SkillGroupSkillID = Skill_Group.SkillTargetID,
    CallbackMessages = SUM(ISNULL(SGHH.CallbackMessages, 0)),
    CallbackMessagesTime = SUM(ISNULL(SGHH.CallbackMessagesTime, 0)),
    AvgHandledCallsTalkTime = SUM(ISNULL(SGHH.AvgHandledCallsTalkTime, 0)),
    HoldTime = SUM(ISNULL(SGHH.HoldTime, 0)),
    HandledCallsTalkTime = SUM(ISNULL(SGHH.HandledCallsTalkTime, 0)),
    InternalCalls = SUM(ISNULL(SGHH.InternalCalls, 0)),
    InternalCallsTime = SUM(ISNULL(SGHH.InternalCallsTime, 0)),
    CallsHandled = SUM(ISNULL(SGHH.CallsHandled, 0)),
    SupervAssistCalls= SUM(ISNULL(SGHH.SupervAssistCalls, 0)),
    AvgHandledCallsTime = SUM(ISNULL(SGHH.AvgHandledCallsTime, 0)),
    SupervAssistCallsTime = SUM(ISNULL(SGHH.SupervAssistCallsTime, 0)),
    HandledCallsTime = SUM(ISNULL(SGHH.HandledCallsTime, 0)),
    PercentUtilization = SUM(ISNULL(SGHH.PercentUtilization, 0)),
    AgentOutCallsTime = SUM(ISNULL(SGHH.AgentOutCallsTime, 0)),
    TalkInTime = SUM(ISNULL(SGHH.TalkInTime, 0)),
    LoggedOnTime = SUM(ISNULL(SGHH.LoggedOnTime, 0)),
    ExternalOut = SUM(ISNULL(SGHH.AgentOutCalls, 0)),
    TalkOutTime = SUM(ISNULL(SGHH.TalkOutTime, 0)),
    TalkOtherTime = SUM(ISNULL(SGHH.TalkOtherTime, 0)),
    AvailTime = SUM(ISNULL(SGHH.AvailTime, 0)),
    NotReadyTime = SUM(ISNULL(SGHH.NotReadyTime, 0)),
    TransferInCalls = SUM(ISNULL(SGHH.TransferInCalls, 0)),
    TalkTime = SUM(ISNULL(SGHH.TalkTime, 0)),
    TransferInCallsTime = SUM(ISNULL(SGHH.TransferInCallsTime, 0)),
    WorkReadyTime = SUM(ISNULL(SGHH.WorkReadyTime, 0)),
    TransferOutCalls = SUM(ISNULL(SGHH.TransferOutCalls, 0)),
    WorkNotReadyTime = SUM(ISNULL(SGHH.WorkNotReadyTime, 0)),
    RecoveryDay = SUM(ISNULL(SGHH.RecoveryDay, 0)), BusyOtherTime = SUM(ISNULL(SGHH.BusyOtherTime, 0)),
    CallsAnswered = SUM(ISNULL(SGHH.CallsAnswered, 0)),
    ReservedStateTime = SUM(ISNULL(SGHH.ReservedStateTime, 0)),
    AnswerWaitTime = SUM(ISNULL(SGHH.AnswerWaitTime, 0)),
    AbandonRingCalls = SUM(ISNULL(SGHH.AbandonRingCalls, 0)),
    AbandonRingTime = SUM(ISNULL(SGHH.AbandonRingTime, 0)),
    AbandonHoldCalls = SUM(ISNULL(SGHH.AbandonHoldCalls, 0)),
    AgentOutCallsTalkTime = SUM(ISNULL(SGHH.AgentOutCallsTalkTime, 0)),
    AgentOutCallsOnHold = SUM(ISNULL(SGHH.AgentOutCallsOnHold, 0)),
    AgentOutCallsOnHoldTime = SUM(ISNULL(SGHH.AgentOutCallsOnHoldTime, 0)),
    AgentTerminatedCalls = SUM(ISNULL(SGHH.AgentTerminatedCalls, 0)),
    ConsultativeCalls = SUM(ISNULL(SGHH.ConsultativeCalls, 0)),
    ConsultativeCallsTime = SUM(ISNULL(SGHH.ConsultativeCallsTime, 0)),
    ConferencedInCalls = SUM(ISNULL(SGHH.ConferencedInCalls, 0)),
    ConferencedInCallsTime = SUM(ISNULL(SGHH.ConferencedInCallsTime, 0)),
    ConferencedOutCalls = SUM(ISNULL(SGHH.ConferencedOutCalls, 0)),
    ConferencedOutCallsTime = SUM(ISNULL(SGHH.ConferencedOutCallsTime, 0)),
    IncomingCallsOnHoldTime = SUM(ISNULL(SGHH.IncomingCallsOnHoldTime, 0)),
    IncomingCallsOnHold = SUM(ISNULL(SGHH.IncomingCallsOnHold, 0)),
    InternalCallsOnHoldTime =SUM(ISNULL(SGHH.InternalCallsOnHoldTime, 0)),
    InternalCallsOnHold = SUM(ISNULL(SGHH.InternalCallsOnHold, 0)),
    InternalCallsRcvdTime = SUM(ISNULL(SGHH.InternalCallsRcvdTime, 0)),
    InternalCallsRcvd = SUM(ISNULL(SGHH.InternalCallsRcvd, 0)),
    RedirectNoAnsCalls = SUM(ISNULL(SGHH.RedirectNoAnsCalls, 0)),
    RedirectNoAnsCallsTime = SUM(ISNULL(SGHH.RedirectNoAnsCallsTime, 0)),
    ShortCalls = SUM(ISNULL(SGHH.ShortCalls, 0)),
    RouterCallsAbandQ = SUM(ISNULL(SGHH.RouterCallsAbandQ, 0)),
    RouterQueueCalls = SUM(ISNULL(SGHH.RouterQueueCalls, 0)),
    AutoOutCalls = SUM(ISNULL(SGHH.AutoOutCalls, 0)),
    AutoOutCallsTime = SUM(ISNULL(SGHH.AutoOutCallsTime, 0)),
    AutoOutCallsTalkTime = SUM(ISNULL(SGHH.AutoOutCallsTalkTime, 0)),
    AutoOutCallsOnHold = SUM(ISNULL(SGHH.AutoOutCallsOnHold, 0)),
    AutoOutCallsOnHoldTime = SUM(ISNULL(SGHH.AutoOutCallsOnHoldTime, 0)),
    PreviewCalls = SUM(ISNULL(SGHH.PreviewCalls, 0)),
    PreviewCallsTime = SUM(ISNULL(SGHH.PreviewCallsTime, 0)),
    PreviewCallsTalkTime = SUM(ISNULL(SGHH.PreviewCallsTalkTime, 0)),
    PreviewCallsOnHold = SUM(ISNULL(SGHH.PreviewCallsOnHold, 0)),
    PreviewCallsOnHoldTime = SUM(ISNULL(SGHH.PreviewCallsOnHoldTime, 0)),
    ReserveCalls = SUM(ISNULL(SGHH.ReserveCalls, 0)),
    ReserveCallsTime = SUM(ISNULL(SGHH.ReserveCallsTime, 0)),
    ReserveCallsTalkTime = SUM(ISNULL(SGHH.ReserveCallsTalkTime, 0)),
    ReserveCallsOnHold = SUM(ISNULL(SGHH.ReserveCallsOnHold, 0)),
    ReserveCallsOnHoldTime = SUM(ISNULL(SGHH.ReserveCallsOnHoldTime, 0)),
    TalkAutoOutTime = SUM(ISNULL(SGHH.TalkAutoOutTime, 0)),
    TalkPreviewTime = SUM(ISNULL(SGHH.TalkPreviewTime, 0)),
    TalkReserveTime = SUM(ISNULL(SGHH.TalkReserveTime, 0)),
    BargeInCalls = SUM(ISNULL(SGHH.BargeInCalls, 0)),
    InterceptCalls = SUM(ISNULL(SGHH.InterceptCalls, 0)),
    MonitorCalls = SUM(ISNULL(SGHH.MonitorCalls, 0)),
    WhisperCalls = SUM(ISNULL(SGHH.WhisperCalls, 0)),
    EmergencyAssists = SUM(ISNULL(SGHH.EmergencyAssists, 0)),
    CallsOffered = SUM(ISNULL(SGHH.CallsHandled, 0)) + SUM(ISNULL(SGHH.RouterCallsAbandQ, 0)) + SUM(ISNULL(SGHH.AbandonRingCalls, 0))+ SUM(ISNULL(SGHH.RedirectNoAnsCalls, 0)),
    CallsQueued = SUM(ISNULL(SGHH.RouterQueueCalls, 0)),
    InterruptedTime = SUM(ISNULL(SGHH.InterruptedTime, 0)),
    RecoveryKey = SGHH.RecoveryKey,
    TimeZone = SGHH.TimeZone,
    RouterCallsOffered=SUM(ISNULL(SGHH.RouterCallsOffered,  0)), 
    RouterCallsAgentAbandons = SUM(ISNULL(SGHH.RouterCallsAbandToAgent, 0)),  
    RouterCallsDequeued = SUM(ISNULL(SGHH.RouterCallsDequeued, 0)),  
    RouterError=SUM(ISNULL(SGHH.RouterError,  0)), 
    ServiceLevel=SUM(ISNULL(SGHH.ServiceLevel,  0)), 
    ServiceLevelCalls=SUM(ISNULL(SGHH.ServiceLevelCalls, 0)),  
    ServiceLevelCallsAband= SUM(ISNULL(SGHH.ServiceLevelCallsAband,  0)), 
    ServiceLevelCallsDequeue=SUM(ISNULL(SGHH.ServiceLevelCallsDequeue,  0)), 
    ServiceLevelError=  SUM(ISNULL(SGHH.ServiceLevelError, 0)),  
    ServiceLevelRONA=SUM(ISNULL(SGHH.ServiceLevelRONA, 0)),  
    ServiceLevelCallsOffered= SUM(ISNULL(SGHH.ServiceLevelCallsOffered,0)),
    NetConsultativeCalls = sum(isnull(SGHH.NetConsultativeCalls,   0)),
    NetConsultativeCallsTime=SUM(ISNULL(SGHH.NetConsultativeCallsTime, 0)),
    NetConferencedOutCalls=sum(isnull( SGHH.NetConferencedOutCalls, 0)),
    NetConfOutCallsTime=SUM(ISNULL(SGHH.NetConfOutCallsTime, 0)),
    NetTransferredOutCalls = sum(isnull(SGHH.NetTransferOutCalls, 0)),
    DbDateTime = SGHH.DbDateTime,
    fte_AgentsLogonTotal=SUM(ISNULL(SGHH.LoggedOnTime,0)) * 1.0 / 1800,  
    fte_AgentsNotReady=SUM(ISNULL(SGHH.NotReadyTime,0)) * 1.0 / 1800,  
    fte_AgentsNotActive=SUM(ISNULL(SGHH.AvailTime,0)) * 1.0 / 1800,  
    fte_AgentsActive=SUM(ISNULL(SGHH.TalkTime,0)) * 1.0 / 1800,
    fte_AgentsWrapup=SUM(ISNULL(SGHH.WorkReadyTime, 0)+ISNULL(SGHH.WorkNotReadyTime, 0)) * 1.0 / 1800,  
    fte_AgentsOther=SUM(ISNULL(SGHH.BusyOtherTime,0)) * 1.0 / 1800,  
    fte_AgentsHold=SUM(ISNULL(SGHH.HoldTime,0)) * 1.0 / 1800,  
    fte_AgentsReserved=SUM(ISNULL(SGHH.ReservedStateTime,0)) * 1.0 / 1800 ,
    ast_PercentNotActiveTime= (CASE WHEN SUM(ISNULL(SGHH.LoggedOnTime,0)) = 0 THEN 0
           ELSE SUM(ISNULL(SGHH.AvailTime,0)) * 1.0 / SUM(ISNULL(SGHH.LoggedOnTime,0)) END),
    ast_PercentActiveTime= (CASE WHEN SUM(ISNULL(SGHH.LoggedOnTime,0)) = 0 THEN 0
           ELSE SUM(ISNULL(SGHH.TalkTime,0)) * 1.0 / SUM(ISNULL(SGHH.LoggedOnTime,0)) END),
    ast_PercentHoldTime= (CASE WHEN SUM(ISNULL(SGHH.LoggedOnTime,0)) = 0 THEN 0
           ELSE SUM(ISNULL(SGHH.HoldTime,0)) * 1.0 / SUM(ISNULL(SGHH.LoggedOnTime,0)) END),
    ast_PercentWrapTime= (CASE WHEN SUM(ISNULL(SGHH.LoggedOnTime,0)) = 0 THEN 0
           ELSE (SUM(ISNULL(SGHH.WorkNotReadyTime + SGHH.WorkReadyTime, 0))) * 1.0 / SUM(ISNULL(SGHH.LoggedOnTime,0)) END),
    ast_PercentReservedTime= (CASE WHEN SUM(ISNULL(SGHH.LoggedOnTime,0)) = 0 THEN 0
           ELSE SUM(ISNULL(SGHH.ReservedStateTime,0)) * 1.0 / SUM(ISNULL(SGHH.LoggedOnTime,0)) END),
    ast_PercentNotReadyTime= (CASE WHEN SUM(ISNULL(SGHH.LoggedOnTime,0)) = 0 THEN 0
           ELSE SUM(ISNULL(SGHH.NotReadyTime,0)) * 1.0 / SUM(ISNULL(SGHH.LoggedOnTime,0)) END),
    ast_PercentUtilization=
    CASE WHEN SUM(ISNULL(SGHH.TalkTime, 0)) = 0 THEN 0
      ELSE ISNULL((SUM(ISNULL(SGHH.TalkInTime, 0)) +
           SUM(ISNULL(SGHH.TalkOutTime, 0)) +
           SUM(ISNULL(SGHH.TalkOtherTime,  0)) +
           SUM(ISNULL(SGHH.WorkReadyTime, 0)) +
           SUM(ISNULL(SGHH.WorkNotReadyTime, 0))) * 1.0 /
            (SUM(ISNULL(SGHH.LoggedOnTime, 0)) - SUM(ISNULL(SGHH.NotReadyTime, 0))), 0)
      END,
    asa=  ISNULL(SUM(ISNULL(SGHH.AnswerWaitTime,0)) * 1.0 / SUM(ISNULL(SGHH.CallsAnswered,0)),0),
    CompletedTasks_AHT =  (CASE WHEN SUM(ISNULL(SGHH.CallsHandled,0)) = 0 THEN 0
           ELSE SUM(ISNULL(SGHH.HandledCallsTime,0)) / SUM(ISNULL(SGHH.CallsHandled,0)) END),
    CompletedTasks_AvgActiveTime=ISNULL((SUM(ISNULL(SGHH.HandledCallsTalkTime, 0)) / SUM(ISNULL(SGHH.CallsHandled, 0))), 0),
    CompletedTasks_AvgWrapTime=ISNULL(((SUM(ISNULL(SGHH.HandledCallsTime, 0)) - SUM(ISNULL(SGHH.HandledCallsTalkTime,0)) - SUM(ISNULL(SGHH.IncomingCallsOnHoldTime, 0))) / SUM(ISNULL(SGHH.CallsHandled,0))), 0),
    ast_ActiveTime = SUM(ISNULL(SGHH.TalkTime, 0)),
    TotalQueued = SUM(ISNULL(SGHH.RouterQueueCalls, 0)) + SUM(ISNULL(SGHH.CallsQueued, 0)),
    ast_PerBusyOtherTime = (CASE WHEN SUM(ISNULL(SGHH.LoggedOnTime,0)) = 0 THEN 0
           ELSE SUM(ISNULL(SGHH.BusyOtherTime,0)) * 1.0 / SUM(ISNULL(SGHH.LoggedOnTime,0)) END),
    Media= Media_Routing_Domain.EnterpriseName,
    AbandCalls = SUM(ISNULL(SGHH.AbandonRingCalls, 0)) + SUM(ISNULL(SGHH.RouterCallsAbandQ, 0)),
    RouterMaxCallsQueued=sum(SGHH.RouterMaxCallsQueued),
    RouterMaxCallWaitTime=sum(SGHH.RouterMaxCallWaitTime)
    FROM Skill_Group (nolock), Skill_Group_Interval SGHH (nolock), Media_Routing_Domain (nolock) 
    WHERE ( Skill_Group.SkillTargetID = SGHH.SkillTargetID ) and 
             ( Skill_Group.MRDomainID = Media_Routing_Domain.MRDomainID )   
    GROUP BY
    Skill_Group.EnterpriseName,  
    Skill_Group.SkillTargetID,
    Media_Routing_Domain.EnterpriseName,
    SGHH.DateTime,
    Datepart(yy, SGHH.DateTime),
    Datepart(mm, SGHH.DateTime),
    Datepart(ww, SGHH.DateTime),
    Datepart(dy, SGHH.DateTime),
    Datepart(dw, SGHH.DateTime),
    CONVERT(char(10),SGHH.DateTime,101),
    SGHH.RecoveryKey,
    SGHH.TimeZone,
    SGHH.DbDateTime
    ORDER BY  Media_Routing_Domain.EnterpriseName ,Skill_Group.EnterpriseName, SGHH.DateTime

  • Help required for dynamic quarter calculation

    I have a requirement, where the user will have the liberty to choose his self defined Quarter and the report output will be grouped based on what he selects.
    The data in the table is at daily grain.
    So ,if the user selects date as 1st April and number of quarters as 2.
    The report should show the data aggregated for previous 2 quarters where 1st April is the start date.
    i.e.Feb-March-April as Q2
    and Nov-Dec-Jan as Q1
    Please suggest how to implement this.
    Best Regards,
    Sud

    Hi,
    Welcome to the forum!
    Whenever you have a question, please post a little sample data (CREATE TABLE and INSERT statements) for all the tables involved, so the people who want to help you can re-create the problem and test their ideas. Also post the results you want from that data, and an explanation of how you get those results from that data.
    If the problem involves parameters (such as the number of quarters you want, and the starting point of one of the quarters) then post a few sets of parameters, and the results you want from the same sample data for each set.
    Explain, using specific examples, how you get those results from that data.
    Always say what version of Oracle you're using (e.g. 11.2.0.2.0).
    See the forum FAQ {message:id=9360002}
    Here's one way you can pass the set the number of quarters, and the starting date of the last quarter wanted:
    WITH   params      AS
         SELECT  TO_DATE ( '01-Apr-2012'     -- Beginning of last quarter
                   , 'DD-Mon-YYYY'
                   )     AS s_date
         ,     5          AS num_quarters
         FROM     dual
    ,     quarters_wanted         AS
         SELECT  ADD_MONTHS ( start_date)
                      , 3 * (1 - LEVEL)
                      )   AS start_dt
         ,     ADD_MONTHS ( start_date)
                      , 3 * (2 - LEVEL)
                      )   AS end_dt
         FROM     params
         CONNECT BY     LEVEL <= num_quarters
    SELECT       q.start_date
    ,       COUNT (*)     AS num_rows
    FROM       quarters_wanted  a
    JOIN       your_table        t  ON  t.date_column  >= q.start_date
                           AND t.date_coplumn <  q.end_date
    GROUP BY  q.start_date
    ;No matter what date you pick (it doesn't have to be the beginning of a month) or how many quarters you want, you only have to change 2 lines in the params sub-query.
    If you want to include quarters that have no data in your table (with a COUNT of 0) then change the inner JOIN in the main query to a LEFT OUTER JOIN.

  • IPCC Ent 7.1 reporting/db question

    Experts,
    I have been asked for reports that show Longest wait time in queue
    The amount of time the queue is full
    I am not much of a programmer and know that I can use something like a global or peripheral variable to get this done, is there an easier way to get data like this? We don't have anyone that can customize reports so I am stuck with having to figure a way to do it with programming.

    With IPCC, the call type set just before the queue to skill group node (or nodes, because there could be complexities with overflow skills and queue to multiple skills) is the key metric to measure the customer experience - how long they wait before being answered. It is not easy to get an exact answer to the question, but you can get a "histogram" on the answer time of the call type by setting up the 10 Bucket Intervals to suit your purposes.
    The Reporting Guide then says:
    WebView Reports for Answered/Abandoned Within Separate Intervals
    WebView provides two call type interval reports that measure answered and abandoned calls for interval increments:
    caltyp31: Call Type Abandon/Answer Distribution by Half Hour (IPCC only) Report
    caltyp32: Call Type Abandon/Answer Before Interval Report
    These reports show calls that abandoned and were answered within the increments that you set: for example, 0-5 seconds, 5-10 seconds, and so on.
    WebView Reports for Answered/Abandoned Accumulated in Intervals
    WebView also provides two call type interval reports that provide cumulative data based on the intervals you configured:
    caltyp33: Call Type Abandon/Answer During Interval by Half Hour Report
    caltyp34: Call Type Abandon/Answer Before Interval by Half Hour Report
    These reports show cumulative data for calls that were abandoned and calls that were answered for the increments that you set: for example, less than 5 seconds (<00:05), less than 10 seconds (<00:10), less than 15 seconds (<00:15), and so on.
    If you were to query the Termination_Call_Detail table you could find out the exact time the longest call had to wait for that call type, but that's a different kettle of fish.
    Regards,
    Geoff

Maybe you are looking for