How can I pull a avg for a range in a lookup statement

I have 2 data sources that I am trying compare  Once has a start date and end date and the other has a constant list of values and dates.  I want to AVG the values for the time between the start and end date in the other table. See example below....
DataSet1
Group         Start                                         End
123         3/21/14 1:00:00PM        3/21/14 5:00:00 PM
124         3/21/14 6:00:00PM        3/21/14 9:00:00 PM
125         3/21/14 9:00:00PM        3/22/14 1:00:00 AM
DataSet2
Datetime                                       Value
3/21/14 1:00:00PM                         33.2
3/21/14 2:00:00PM                         34.2
3/21/14 3:00:00PM                         31.2
3/21/14 4:00:00PM                         37.2
3/21/14 5:00:00PM                         33.2
3/21/14 6:00:00PM                         34.2
3/21/14 7:00:00PM                         31.2
3/21/14 8:00:00PM                         37.2
ETC......
I want it o make a table that shows ...
Group         Start                                         End                           
AVG Value for time
123         3/21/14 1:00:00PM        3/21/14 5:00:00 PM                           
124         3/21/14 6:00:00PM        3/21/14 9:00:00 PM                           
I can get the value for the start date and end date but I need all values Averaged.  Any ideas?

Hi mbh23,
After testing the issue in my environment, we can refer to the steps below to achieve your requirement:
Drag a table to design surface, insert Datetime field, Datetime field and Value field.
In the Row Groups pane, right-click the Details group to add a parent group grouped by the expression below:
=iif(Fields!Datetime.Value>="3/21/14 1:00:00PM" and Fields!Datetime.Value<"3/21/14 6:00:00PM",123,iif(Fields!Datetime.Value>="3/21/14 6:00:00PM" and Fields!Datetime.Value<"3/21/14 10:00:00PM",124,125))
Right-click the Details Group to add a total row after.
Modify the expressions of new row to like below:
=First(Fields!Datetime.Value)                =Last(Fields!Datetime.Value) 
=Sum(Fields!Value.Value) / Count(Fields!Datetime.Value)
Right-click the second row to select Row Visibility with Hide option in the table.
The following screenshot is for your reference:
If there are any other questions, please feel free to ask.
Thanks,
Katherine Xiong
If you have any feedback on our support, please click
here.
Katherine Xiong
TechNet Community Support

Similar Messages

  • How can i pull alv layouts for selection screen ?

    hello ,
    i search way to give the user option to choose his layout,
    i sow here examples that look good , but 
    all of tham talk about function :
    "REUSE_ALV_VARIANT_DEFAULT_GET"
    i run it in 'se37' and no data is pull ,
    i know that there is layouts for my alv report ,
    i use it like this in my report and in 'se37' :
    CLEAR ls_variant.
      ls_variant-report = sy-repid.
      ls_variant-handle = 'LIST'.
       MOVE ls_variant TO def_variante.
       MOVE vari TO def_variante-variant.
    CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
        EXPORTING
          i_save     = 'A'
        CHANGING
          cs_variant = def_variante
        EXCEPTIONS
          not_found  = 2.
      IF sy-subrc = 0.
        p_vari = def_variante-variant.
      ENDIF.
    thanks

    Hi,
    Try this.
    INITIALIZATION.
    Get Default display variant
      PERFORM f200_display_default_variants.
    Enable variant saving
    data   w_variant TYPE disvariant.
    FORM f200_display_default_variants.
    *initialize to default layout if one exist.
      w_variant-report   = sy-repid.
      CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
           EXPORTING
                i_save        = 'A'
           CHANGING
                cs_variant    = w_variant
           EXCEPTIONS
                wrong_input   = 1
                not_found     = 2
                program_error = 3
                OTHERS        = 4.
      IF sy-subrc EQ 0.
        p_layout = w_variant-variant.
      ENDIF.
    ENDFORM.
    Try this and reward points by clicking the star on the left of reply,if it helps.

  • How can I pull the BUKRS (company code) value, for a X_USER (sy-uname) inpu

    HI Experts,
    Pls. clarify that, How can I pull the BUKRS (company code) value, for a X_USER (sy-uname) as input?
    ThanQ.

    Check with USRM1 Table
    give user name (Uname ) and you get company code (BUKRS)
    also check with other tables : USRM* in SE11
    Thanks
    Seshu

  • How can i pull the

    Hi folks
    iam developing report for following requirement.
    want to disply the vendor transaction file for all company codes  Fiscal year,of 2004,2005,2006, and 2007 (to date).
    The purpose of oureport is to analyze our company  invoices and investigate potential overpayment opportunities.  In order to effectively accomplish this, we need a single invoice record for each invoice that was received by compnay  from their vendors.  The single invoice record would contain at least the following columns: Vendor Number, Vendor Invoice Number, Invoice Date, Invoice Amount, SAP Document Number, Check/Wire Number, Check/Wire Date, Check/Wire Amount.    SAP would have multiple rows in a table for any one invoice, whereas we would only want to see ONE row for every vendor invoice.
    if you know that company pays (for example) 75,000 invoices/year - then the transaction file you would have about 300,000 records in it.  75,000 Invoices * 4 years. 
    inodrer to develop this report iam using table PAYR -payee
    BSIK ( closed items) BSAK ( open items).
    my question is any one tell me how can i pull the payment transactions for each invoice?
    regards
    neeru

    try to use function module GET_CHECK_INFORMATION
    hope that helps
    Andreas

  • I was running Firefox on another computer that lost it's motherboard, was able to salvage the harddrive, but my mail files on the older hard drive have a different name, how can I pull or import those older files into firefox running on another computer?

    I had been running other email clients for years and finally switched to Firefox. All the while importing my other email folders. So I had quite a large history of email. I had been backing up my system using Acronis for years. My desktop's motherboard crashed and was not worth repairing. I pulled my desktop hard drive and turned it in a standalone drive. I re-established my email on a laptop starting from scratch using Firefox. I would like to import (if possible) the emails history that is stored on the standalone drive (formerly my old hard drive). However, the names of the mail folders on the drives are different. For example: current computer the mail folder is named garlic.com. On the standalone drive (old hard drive) there are several folders and they are named, for instance; mail.garlic.com, mail.garlic-1.com , and so forth. it goes up through garlic-4.com.
    How can I pull or import these older folders into my current email folder and see all my old email archives?

    You are not going to be able to run your old system from the backup on this old computer as the hardware is incompatible.
    You need to get a new computer or a refurbished one.

  • How can i pull out data from a spreadsheet only from the current month?

    Data is constantly being fed into a spreadsheet using a VI, this data comprises of such things as month, year, weights, std dev, etc.  I want to do some data manipulation on the current months data while the VI is running, how can I pull out only the data relating to the current month?  Each input into the spreadsheet stores the values for that run on one row, and there are perhaps 150 runs each month
    Any thoughts are greatefully received
    Thanks
    Ross
    Attachments:
    Results.xls ‏1 KB

    Hi Ross,
    I thought I would go away and make you an example VI for the results xls that you have sent me.
    Here it is:  I have added a few comments here and there but if you need more info please don't hessitate to post back on the forum
    Hope if helps
    AdamB
    National Instruments
    Applications Engineering Team Leader | National Instruments | UK & Ireland
    Attachments:
    MonthExtract.vi ‏43 KB

  • Can we pull two addresses for 0Person OR 0Employee ?

    Hello all,
    I was checking in R/3 side in tcode PA30 that for 0EMPLOYEE there can be multiple address like permanent address, temporaray address, mailing address.
    How can we pull all these address in BW system. I do not see any mapping for address field in 0EMPLOYEE and for 0PERSON i see mapping for only one address so how can that be done?
    Please someone advice if they have encountered this before?
    Thanks

    Hi,
    you can do that in multiple ways. One is to create a ods object and store all adresses related to a person in that ods. Or you can enhance the attributes of 0person or 0employee by additional address fields to post the data directly to that characteristics. But I think for both approaches you need to enhance a standard extractor or create a new one.
    kind regards
    Siggi

  • How can I pull out this calendar to schedule report

    Hi expert,
          there is no calendars for report scheduling in infoview, please have a look at attached file. how can I pull out this calendar to schedule report.
    Many Thanks,

    Hello Zhang,
    You have to create the calendar in the CMC then use it when scheduling.
    See KB article https://bosap-support.wdf.sap.corp/sap/support/notes/1651984
    Regards,
    Monia.

  • HT204053 Dear Support Team, every time i tried to logon Icloud its gives me wrong user name or password and at the end it show me error " This Apple ID is valid but is not an ICloud Account" then how can i use one account for same Apple ID and ICloud???

    Dear Support Team,
    Every time i tried to logon Icloud its gives me wrong user name or password and at the end it show me error " This Apple ID is valid but is not an ICloud Account" then how can i use one account for same Apple ID and ICloud?
    Thanks

    It is not possible to create a new iCloud account using a Windows machine. You must create the account using a Mac (10.7.5 or more) or an IOS device (iPhone etc). Once that is done you can sign into and use the account on your Windows machine.

  • How can i make a email for my printer

    how can i make a email for my printer to send the things to the email and get it printed if i was out of the house my printer model is 3525

    Hi alhashmi_sy,
    Welcome to the HP Support Forums. I see that you would like to learn how to setup the ePrint feature of your Deskjet Ink Advantage 3525 printer.
    The first step is to connect your printer to your wireless network. Please follow the steps in the Installing the Printer Software for a Wireless Network Connection document for your operating system. If you have already setup your printer with a USB cable, each operating system section has the steps to switch from the USB connection to a wireless connection.
    After connecting the printer to your wireless network please follow the steps for Getting the Printer Claim Code. Once you have the web services information sheet with your claim code please Set Up a Custom Email Address for ePrint.
    You should now have a customized ePrint email address for your printer. If you run into any issues please let me know at what step things went awry and the contents of any error messages. Please also let me know what operating system you are using on your computer (whatsmyos.com). Thank you.
    Regards,
    Happytohelp01
    Please click on the Thumbs Up on the right to say “Thanks” for helping!
    Please click “Accept as Solution ” on the post that solves your issue to help others find the solution.
    I work on behalf of HP

  • I forgot My iCloud password, and i can not reset it as the system is not accepting the answer to the security questions and also the mail to my apple ID mail box is blocked, how can i reset my password for my apple ID.

    I forgot My iCloud password, and i can not reset it as the system is not accepting the answer to the security questions and also the mail to my apple ID mail box is blocked, how can i reset my password for my apple ID.

    Hello nmssns,
    Thank you for contacting Apple Support Communities.
    You can start with this article to reset your iCloud password. Depending on your exact circumstances, blocked email, forgot security questions, etc., there are links provided to guide you through those issues.
    About Apple ID security questions
    http://support.apple.com/kb/HT5665
    Regards,
    Jeff D.

  • Can 2 different users with 2 different Iphones use the same itunes to backup each phone separately? if not how can I have a backup for 2 different iphones on the same laptop?

    can 2 different users with 2 different Iphones use the same itune program to backup each phone separately? if not how can I have a backup for 2 different iphones on the same laptop?

    Here is your answer:
    http://support.apple.com/kb/HT1495

  • If I have two email accounts, one personal hotmail account and one MS Exchange work account, how can I setup individual notifications for each account. Right now, any email from any account has the same notification. I want work to be different than perso

    If I have two email accounts, one personal hotmail account and one MS Exchange work account on my iPhone 4s, How can I setup individual notifications for each account? Fore example, if I get a work email, I want to hear a DING, DING....If I get a personal email, I want to hear a BEEP, BEEP. Right now, any email from any account has the same notification. I want work incoming email notification to be different than personal incoming notification. The only semi-workaround I've seen is just disable any notification for the Hotmail account, so only work emails would notify. But then I don't know when I get a personal email. Even the lowely Blackberry Torch 9800 has this feature..not iPhone 4s??
    Thanks

    Sorry you get only one notification sound for all email accounts.  you can send a suggestion to apple here http://www.apple.com/feedback/

  • How can I find my password for iTunes?  Forgot it and can't see how to restore or change

    How can I find my password for iTunes?  Forgot it and can't see how to restore or change it.  It is not the same as the apple id password - or so my iPhone iTunes says - Help

    I don't want to reset my apple ID password. I know it's right. It doesn't work on Itunes to restore my phone. All the passwords I know are not working. I want to know why.

  • Help - I have an apple id account, where is my iPod and iPad registered, but also the iPod of my daughter. How can I make an account for my daughter and keep all the apps she has on her iPod?

    Help - I have an apple id account, where is my iPod and iPad registered, but also the iPod of my daughter. How can I make an account for my daughter and keep all the apps she has on her iPod and in her own iTunes?

    Sorry, content bought with one Apple ID cannot be merged or transferred to another Apple ID.

Maybe you are looking for

  • Date Range and Null Values

    Post Author: mrae CA Forum: Formula I want to pull up data that have been completed for the month, but also want to include null values.  I did the following but didn't work. (isnull({wrhwr.date_completed}) or {wrhwr.date_completed} => 4/1/2008 12:00

  • Import/Export extension not working with DW4

    I am trying to export my site definitions from Dreamweaver 4.0 so that I can import them into CS4. I installed the Extension Manager 1.5 and used it to install MX157851_siteImpExp1_0_3.mxp But I don't get a new menu item File/Export in my DW4 menu, s

  • Driver Notebook HP

    HiI have an HP Pavilion Notebook dv6-6b55sl with windows 7 64bit .. later go on to windows 10 .. I wanted to know if you will update the drivers for this notebook on the site hp ..

  • Error erase Queries in Query Manager- The query is used with user-define...

    Hello Experts I have deleted a User Field that had a Formatted Search and now I can not remove it because it is linked according to a UF, the error message is as follows: "The query is used with user-defined values [Message 952-23]" There will be a w

  • No signal, no sim-card message

    Hello, iPhone 4 shows me a "No sim-card" message and losing a provider's signal periodically after upgrading to OS6. Can I fix this problem somehow? Thanks in advance. Sergey