Finding the highest flow period for a day

Now I really got stuck. I need to find what period for a day (full 24h) that have the highest flow. To make things a bit harder we cant used fixed periods. We have the flow per minute to work with.
Example with 10 minutes and we look for a 5 minute period:
Time ; Flow
0700 ; 14
0701 ; 12
0702 ; 18
0703 ; 19
0704 ; 12
0705 ; 16
0706 ; 10
0707 ; 10
0708 ; 15
0709 ; 14
In this case the highest flow for the period would be between 0701 and 0705 with a total flow of 77. So the needed answer would be 0701 and 77
In the situation where it will used in reality it will be finding a 15 minute period from 1440 minutes we have for a day.
I hope someone can provide me with ideas of how to solve this thing.
Regards,
Jonas

Are you guaranteed to have a row for every minute?
Oracle9i Enterprise Edition Release 9.2.0.6.0 - 64bit Production
JServer Release 9.2.0.6.0 - Production
SQL> DROP TABLE t;
Table dropped.
SQL> CREATE TABLE t (time VARCHAR2 (4), flow NUMBER);
Table created.
SQL> INSERT INTO t VALUES ('0700', 14);
1 row created.
SQL> INSERT INTO t VALUES ('0701', 12);
1 row created.
SQL> INSERT INTO t VALUES ('0702', 18);
1 row created.
SQL> INSERT INTO t VALUES ('0703', 19);
1 row created.
SQL> INSERT INTO t VALUES ('0704', 12);
1 row created.
SQL> INSERT INTO t VALUES ('0705', 16);
1 row created.
SQL> INSERT INTO t VALUES ('0706', 10);
1 row created.
SQL> INSERT INTO t VALUES ('0707', 10);
1 row created.
SQL> INSERT INTO t VALUES ('0708', 15);
1 row created.
SQL> INSERT INTO t VALUES ('0709', 14);
1 row created.
SQL> COMMIT;
Commit complete.
SQL> SELECT time, flow
  2  FROM  (SELECT time, flow,
  3                RANK () OVER (
  4         ORDER BY flow DESC) flow_rank
  5         FROM  (SELECT TO_CHAR (time, 'HH24MI') time,
  6                       SUM (flow) OVER (ORDER BY time
  7                         ROWS BETWEEN CURRENT ROW AND 4 FOLLOWING) flow
  8                FROM  (SELECT TO_DATE (time, 'HH24MI') time, flow
  9                       FROM   t)))
10  WHERE  flow_rank = 1;
TIME       FLOW
0701         77
SQL>

Similar Messages

  • How to find the data flow for a given module.

    Hi ,
    Is there a way to find the data flow for a given module(Example AR,AP,......).
    I mean are there any predefined document other than user guides that explains with data flow diagrams(including the tables involved).
    Any help would be greatly appreciated.
    Thanks & Regards,
    Naveen.

    No such public document available from Oracle unless from Oracle Education.
    for some specific operation you can check Process tab inside Oracle Application which shows the data flow as part for workflow process.
    Regards
    Prashant Pathak

  • HT4623 I have an IPad Model MC497LL with version 4.2.1 (8C148) where do I find system updates to get this device to the highest version possible for this model?

    I have an IPad Model MC497LL with version 4.2.1 (8C148) where do I find system updates to get this device to the highest version possible for this model?

    Go back to the article you asked this question from, ignore the instructions for updating it wirelessly, scroll down, and follow those for updating it from iTunes on a computer.
    (93330)

  • Find the std Business content for these objects in CRM..

    Hi,
    Can you please help me in finding
    To identify the standerd BW extractors in the Business Content.
    From the CRM
    Business Content for the following objects
    Product ( New products in CRM and not in R/3)
    Sales Orders à
    à Line items.          
    Quotations            CRM only
    Billing Documents            CRM
    Credit Notes           
    Customers  - àNot fully registered " prospects will be in CRM only.
    Customers will be transported to R/3
    IBASE            àMaster Data Item
    àContent?
    Activities            CRM
    Please help me how can I find the std Business content for these objects in CRM..

    CRM Business content objects:
    0CRM_LEAD_H - Lead Header (Transactional Data)
    0CRM_LEAD_I - Lead Item (Transactional Data)
    0CRM_MIG -  Mail GUID
    Characteristics
    InfoObject     Description
    0CRM_LEAGUI     Lead GUID
    0STAONESYS0     CRM status life cycle (One Order)
    0STAONESYS4     CRM status opportunity/lead (One Order)
    0CRM_RCA     Catalog
    0CRM_RG     Code group
    0CRM_RCO     Code
    0CRM_PROSPE     Prospect
    0BP_CONTPER     CRM contact partner
    0BP_RESPPER     CRM owner
    0CRM_SALESP     CRM sales partner
    0CRM_OBJTYP     Business transaction object type
    0CRM_ITOBTP     CRM item transaction type (object type)
    0CRM_MKTELM     CRM marketing element
    0CRMPLEAGUI     CRM preceding lead GUID
    0CRM_LEADCR     Creation date of the lead
    0CRM_OPPGUI     GUID of a preceding opportunity
    0CRM_OPPCRD     Creation date of the opportunity
    0CRM_PREOTP     Object type of the preceding document
    0DIVISION     Division
    0DISTR_CHAN     Distribution channel
    0CRM_SRVORG     CRM service organization
    0CRM_SALOFF     Sales office
    0CRM_SALORG     Sales organization
    0CRM_SALGRP     Sales group
    0CRMSA_OG_R     Responsible organizational unit (sales)
    0CRMSE_OG_R     Responsible organizational unit (service)
    0CRM_PRHIER     Product category ID
    0CRM_PROD     CRM product
    0CRM_ORDPRD     Product name entered
    0MATERIAL     Material (allocation to R/3)
    Time Characteristics
    InfoObject     Description
    0CALDAY     Calendar day
    0CALMONTH     Calendar year/month
    0CALQUARTER     Calendar year/quarter
    0CALYEAR     Calendar year
    0FISCPER     Fiscal year/period
    0FISCYEAR     Fiscal year
    0FISCVARNT     Fiscal year variant
    Key Figures
    InfoObject     Description
    0CRM_NUMDOC     Number of order headers
    0CRM_NUMOFI     Number of order items
    0CRM_LDOQV     CRM: Expected order quantity in VME
    0CRM_LDOQB     CRM: Expected order quantity in BME
    0CRM_DURLEA     Duration of the lead
    0CRM_EXDULD     Expected duration of the lead
    0CRM_NUMACT     Number of activities per lead
    0CRM_NUMCHL     Number of changes in the qualification level per lead
    0CRM_LEAWON     Won leads
    Units
    InfoObject     Description
    0SALES_UNIT     Sales unit
    0BASE_UOM     Base unit of measure
    InfoCube 0CSAL_C01 - CRM Activities.
    ODS Object 0SAL_DS01 (ODS for Activities)
    Query (technical name)     Query (description)
    0CSAL_C01_Q0006                    Success/Failure Analysis
    0CSAL_C01_Q0016                    Activity History
    0CSAL_C01_Q0002                     Intensity of Customer Care  (Owner) 12M
    InfoCube  Opportunities - 0CRM_C04 (SAP BW Business Content)
    InfoSources
    CRM Opportunities: Header Data - 0CRM_OPPT_H
    CRM Opportunities: Item Data - 0CRM_OPPT_I
    Query (technical name)     Query (description)
    0CRM_C04_Q0100                 Channel Management Sales Forecast
    0CRM_C04_Q001               Win/Loss Analysis for Opportunities
    0CRM_C04_Q002               Sales Volume Forecast
    0CRM_C04_Q003                 Pipeline Analysis per Phase
    Hope it will helps you a lot..........

  • I have 3 mail accounts in apple mail. One of them has had the spinning ball going for several days and I cannot receive mail in this account. I can receive mail in this account on my iPad and by signing into aol on safari. It's obviously a glitch in Apple

    I have 3 mail accounts in apple mail. One of them has had the spinning ball going for several days and I cannot receive mail in this account or delete messages etc. For some  reason, I CAN send mail on Apple mail using this account, although it takes several minutes. I can receive mail in this account on my iPad and by signing into aol on safari and internet explorer on my office PC. It's obviously a glitch in Apple's Mail. I've deleted this account and reopened it in Mail on my Mac Pro with no difference. Any suggestions would be greatly appreciated, this E amil account is major to my business.

    http://support.apple.com/kb/TS3276
    sounds like a corrupt database or index
    the glitch is your home folder and mail folder, esp look at syncservices
    I'd post in the mail or Lion forum where you will find similar issues being discussed.
    http://www.apple.com/support/mail

  • How to use my findTheHighest method to find the highest value in my two dim

    I am going to create a 13row by 10 colume two dimensional array.
    how to use my findTheHighest method to find the highest value in my two dimensional array.
    .When i compile this program , i got those as following;
    "Exception in thread "main" java.lang.ArrayIndexOutOfBoundsExce
    at TaxEvolution.findTheHighest(TaxEvolution.java:31)
    at TaxEvolutionClient.main(TaxEvolutionClient.java:25)"
    public class TaxEvolution{
    public double[][] salesTaxRates;
    public TaxEvolution()
      salesTaxRates = new double[13][10];
      fillProvinTaxRates();
    private void fillProvinTaxRates()
      for ( int row = 0; row < salesTaxRates.length; row++ )
        for ( int column = 0; column < salesTaxRates[row].length; column++ )
          salesTaxRates[row][column]= (int)(Math.random()*5000) + 1;
    public double findTheHighest()
        double highest = salesTaxRates[0][0];
        for ( int row = 0; row <= salesTaxRates.length; row++ )
          for ( int column = 0; column <= salesTaxRates[row].length; column++ )
             if ( salesTaxRates[row][column] >= highest )
                   highest = salesTaxRates[row][column];
        return highest;   
    public double[][] arrayTaxEvolution()
      double[][] returnTaxRates = new double[13][10];
      for ( int row = 0; row < salesTaxRates.length; row++ )
        for ( int column = 0; column < salesTaxRates[row].length; column++ )
          returnTaxRates = salesTaxRates;
      return returnTaxRates;
    public class TaxEvolutionClient{
    public static void main( String[] args ){
      TaxEvolution protaxRateList = new TaxEvolution();
      double[][] taxRateList = protaxRateList.arrayTaxEvolution();
        for ( int i = 0; i < taxRateList.length; i++ )
          for ( int j = 0; j < taxRateList[0].length; j++ )
            System.out.print( taxRateList[i][j] + "\t" );               
            System.out.print( protaxRateList.findTheHighest + "\t" );
    }

    Multiposted
    http://forum.java.sun.com/thread.jspa?threadID=699057&tstart=0

  • How to activate the option posting period for T.code F.2E

    HI All,
    When we execute T.code F.2E the selection parameters available are
    1. company code
    2. partner company code
    3. open at key date
    4. display currency.
    As the program documentation says we can reconcilie by selecting option for posting period in F.2E
    Below is the SAP documentation on the program.
    You use the Posting period selection option to specify the time period in which the posting dates of the documents need to fall in order to be included by the program. Open items, cleared items, and payment documents are all selected. See the section Parameter Open for key date and Selection Option Posting period for further information. If you want to start the program with this date selection, the option must be selected accordingly.
    But the field for posting period is not available in selection parmeter, we are on 4.7 EE version.
    Please let me know how to activate the option for posting period in selection parameters for T.code F.2E
    Thanks in advace.
    Regards,
    Raj.

    Hi,
    I have tried to execute the program FBICRC003_DATA_REC. But program doesn't exist.
    We are on 4.7 version. I have executed program RFICRC00, but stil can't find the option posting period.
    Please confrim.
    Thanks
    Regards,
    Raj.
    Edited by: Raj Racha on Dec 27, 2010 10:58 AM

  • How to set the spool retention period till 30 days(Printer Properties).

    Hi SAP Experts
    I need to setup a job which creates a spool. I want to set the spool retention period till 30 days(Printer Properties). But I have the option of keeping it only for 8 days or Do Not Delete at all. Can you please let me know how can I setup a job which creates a spool which wil be retained for 30 days and then will automatically get deleted?
    Advanced Thanks
    Thanks & Regards,
    Kishore.

    Hello Kishore,
    I can understand why you dont want to change the variant.
    However may be a slight change in the variant might help your cause though I am not sure whether you will like this suggestion or not.
    Create a dummy output device type to which all spools created for this report need to be assigned.
    Once this is done  make a small change in the variant for the field Output device in such a manner that all the spools belonging to this printer/output device are not deleted.
    Then create a new variant for this output device ensuring that only spools belonging to this output device and older than 29 or 30 days  are deleted.
    While this will  ensure that normal spool requests are deleted these ones are not.
    Really dont if this solution is acceptable or not.
    Regards.
    Ruchit.

  • TA48312 How can i update my osx software from my emac from osx 10.3 to the highest available software for an emac?

    How can i update my osx software from my emac from osx 10.3 to the highest available software for an emac?
    I have osx 10.3.x and i want to update to the highest possible. Please help!!!!! i cant find the download. And i dont want to lose any data!!

    Depending upon the specific model you have you can upgrade to either 10.4.x or 10.5.x. Neither are available from Apple any longer, so you will need to look to eBay or Amazon for copies. Be sure to only purchase retail copies and not gray labled machine-specific copies.
    If your eMac came with 10.3 originally and has a clock speed of 1 GHz or higher, then you can install Leopard, 10.5.x.
    If you don't want to lose data then make backups.

  • How do I find the valid IP address for the base station?

    I am trying to install he Airport Extreme but I am receiving this message:  The wi-fi base station does not have a valid IP address. How do I find the valid IP address for the base station?

    I have run an ethernet cable from the modem to my Mac and I do have internet connection. But when I connect that ethernet to the TC and run Airport Utility to set it up I get the error about no valid IP address.
    This tells us that the modem has associated with your computer. The modem "remembers" the settings for your computer and "looks" for it when you connect the TC. It does not "see" the computer, so it does not associate with the TC.
    The modem needs to be reset so that it will not remember the computer. Then it will associate with the next device that connects.
    Look for a reset button on the modem, and if present, push it for a second or two. Then power off the modem and leave it off for at least 30 minutes. Power off everything else as well.
    After the wait period, power up the modem and let it run for 4-5 minutes by itself. Then power up the TC and let it run a few minutes. Power up each other device one at a time about a minute apart.
    Check to see if the modem is now associating with the TC so that the TC will get a valid IP address.

  • FM/Class to find the class and characterstics for a given material

    Hi All,
    Is there any Class/FM to find the class and characterstics for a given material.I tried some BAPI_OBJCL* BAPI's but lot of the BAPI's need classnum as input parameter. But i need a BAPI or tables or class which can give the class and its characterstic values for a given material.

    Hi Ben
             Try ..
    BAPI_OBJCL_GETCLASSES
    BAPI_OBJCL_CREATE

  • Could not find the policy in WMI for package

    Hi,
    I am trying to deploy a language pack to a windows 8.1 machine and it is not installing. According to the execmgr.log it cannot find the policy in WMI? I have tried running the machine policy update within CFG MGR but no change. Is there something else
    I can check?
    <![LOG[Policy is updated for Program: InstallEN, Package: LIA002A0, Advert: LIA2011A]LOG]!><time="09:47:18.345+300" date="01-28-2015" component="execmgr" context="" type="1" thread="980"
    file="execreqmgr.cpp:7063">
    <![LOG[Raising client SDK event for class CCM_Program, instance CCM_Program.PackageID="LIA002A0",ProgramID="InstallEN", actionType 45l, value NULL, user NULL, session 4294967295l, level 0l, verbosity 30l]LOG]!><time="09:47:18.347+300"
    date="01-28-2015" component="execmgr" context="" type="1" thread="980" file="event.cpp:405">
    <![LOG[Mandatory execution requested for program InstallEN and advertisement LIA2011A]LOG]!><time="09:47:19.220+300" date="01-28-2015" component="execmgr" context="" type="1" thread="3684"
    file="execreqmgr.cpp:3527">
    <![LOG[Creating mandatory request for advert LIA2011A, program InstallEN, package LIA002A0]LOG]!><time="09:47:19.220+300" date="01-28-2015" component="execmgr" context="" type="1" thread="3684"
    file="execreqmgr.cpp:3653">
    <![LOG[Could not find the policy in WMI for package LIA002A0 program InstallEN]LOG]!><time="09:47:19.242+300" date="01-28-2015" component="execmgr" context="" type="2" thread="3684" file="softdistpolicy.cpp:2851">
    <![LOG[CreateMandatoryRequestRecursively failed at FindUserOrSystemPolicy InstallEN]LOG]!><time="09:47:19.243+300" date="01-28-2015" component="execmgr" context="" type="2" thread="3684"
    file="execreqmgr.cpp:3670">

    Did you check this
    post?
    It turned out the root cause of the problem was one of the packages that the TS called.  Even though SCCM had been set to use the selected distribution points and said the package was installed on those DPs, it hadn't actually copied the files over.
     Updating to a new source version and ensuring the files copied correctly resolved the issue.  Hopefully SCCM 2012 will do a better job of communicating a dependency problem, but I haven't had a chance to test it yet.
    You can also check this
    post.
    it appears the majority of these messages occur when you have a system that has an expired advertisement still being applied to it. 
    Nick Pilon | Blog : System Center Dudes

  • Dont find the correct video drivers for my T61 + windows 7 ultimate + intel pm965 video card

    Hi Experts,
    I am keep getting the stop error 0x00000116 failing with a blue screen while im browsing. I have observerd this quite a few times and also I could not find the correct video drivers for my t61 thinkpad in the ibm site. I could see the details as wxp & windows vista but not for win 7. Please find the link below which has all the video drivers fro t61. Please help me find the correct customized video drivers fro my t61 + win 7. Hope you understand my problem.
    By the way i just use for home computing and my win 7 is upto date wiht no extra software and games installed. I dont play games at all on my t61.
    my t61 specificaitons : http://www-307.ibm.com/pc/support/site.wss/document.do?lndocid=MIGR-67883
    If you see the link http://www-307.ibm.com/pc/support/site.wss/document.do?sitestyle=lenovo&lndocid=MIGR-67853
    if u search in the baove link ,you cannot find the video drivers for t61 + win 7. You have it only for xp & vista in this section. Intel X3100 (940GML, 945GM, GL960, GM965). there are no video drivers for win 7 for t61. my video card info is
    Video chipsets:
    Intel PM965/GM965 graphics. (15.4 inch).
    my video card is Intel PM965 chipset . Please help me to get the correct customized version of the video drivers for my thinkpad as I am getting this problem with video drivers and its getting restarted when I am in the middle of something. But it works find after that. I have tried to install drivers from intel and its saying i have customized version of lenovo drivers and I should contact you guys. I triedcomplete  win 7 update from windows site and installed all patches and still getting the problem intermitently, but after restart it works fine. No hardware or software changes. Its that I need the correct version of video drivers for win 7. Please inform the lenovo about this and ask them to develop the good video drivers for win 7 + t61 model. Hope you understand my situation.
    Please let me know if you need any kind of info so that i can provide.
    thanks for reading the mail.
    Regards,
    Manu

    Are you kidding me ? You dont work for Lenovo and you are an active volunteer here in this forums. I have seen your replied many times and wont get paid by Lenovo, you are really crazy for ur stufee .Anyways thanks a lot for the link and the original lenovo staff were notable to provide the link and you could. Well I have tried that what you have said nd still I could not get the link, here you go..
    http://www-307.ibm.com/pc/support/site.wss/product.do?doccategoryind=50880&template=%2Fproductpage%2...
    Let me install the drivers from your link and I will reply soon, so who ever search in this forum now , there wont be any problems for t61 windows 7 video drivers because of u. You are awsome.wll reply my results soon.

  • FF not connecting to web- This "Network Connections" message pops up: Error 623: The system could not find the phone book entry for this connection. Any ideas?

    About a month ago I could no longer connect to the internet on our PC. Every time I clicked on the Firefox icon the Netscape sign-on window would pop up. I would try to close it but it would pop up over and over again. If I tried to close it a dozen or so times eventually Firefox would open up but it would never connect. Just today I moved my Netscape file to the recycle bin. No longer does the Netscape sign-on window pop up but following Network Connection error message pops up: "Error 623: The system could not find the phone book entry for this connection".. This error window behaves the same way the Netscape sign-on window used to behave. Every time I click to close it it pops open again. After numerous clicks Firefox opens up but it never connects.

    Do you have this error message on a Mac computer or on a Windows computer?
    I've only seen this error mentioned on a Windows computer.
    *http://kb.mozillazine.org/Autoconnect

  • How to find the exact user exit for our requirement?

    Dear Mr. keerthi,
    can you please explain me how to find the exact user exit for our requirement?

    Hi sandip
    There is more than one method in which you can check for user-exits.The following method is used very often.
    <b>How to find the exact user-exit for your requirement.</b>
    1.     You can check the user exists using transaction SE85.
    2.     Repository Information System -> Enhancements -> Customer exits
    3.     You can search the user-exits by package name.
    4.     Double click on each exit name to check the function module exits.
    <b>The procedure to find the package name.</b>
    Execute transaction SE93 
    Enter the tcode of the transaction for which you want to check the user exit.
    Example: if you want to find the user-exit for purchase orders while changing, enter ME22n  and press display.
    You will get to see the package name
    But you need to confirm that the user exit will get triggered at the appropriate event.
    ( example: you might want some validations to be done ON SAVE of a purchase order)
    <b>Checking if the user-exit is getting triggered or not.</b>
    1.     Open the user exit function module (that you have got in step 4) in Tcode SE37.
    2.     Click on where used button. In the pop up that immediately appears choose only programs .
    3.     You will get a list of programs. Double click on the program name.
    4.     You will get the list of location where this function module user exit is used.
    5.     Place session break points at each of these location ( at each CALL FUNCTION statement)
    6.     Now go to your transaction ( say change purchase order tcode:Me22n) and check if the user exit is getting triggered on appropriate event.
    regards,
    Prasad

Maybe you are looking for

  • How do I use Javascript to populate a text field based on a selection from a drop down box?

    Greetings, I have virtually no experience with JavaScript and I am trying to figure out how to add some basic automation features to an Adobe form.  I have a drop down box called "Hospital_Name" that will contain approximately 7 possible selections. 

  • Transport a smartform

    Hi everybody, do you know how to transport a smartform and the standard text from on system to another? thank you

  • Hyper V Integration Components of Windows 2012R2

    Hi Team, I am receiving the above error during installation of Hyper Integration Components of Windows 2012R2. VM OS is windows 2008 std Sp2  Hyper is WIndows 2012 R2. I have created a VM from Physical server to Virtual. Please suggest me the solutio

  • Moto X 2nd 2014 error after lollipop update

    I've got moto x xt1096, and faced with terrible bug after update to 5.0. Time to time on day faced with crash and restart of stock launcher with error "unfortunatelly google search (or app) has stopped" I made a topic on motorola forum, but didn't fi

  • Can grow and Vertical Alignment

    Post Author: David Jones CA Forum: Crystal Reports I have a report that has several cells in the Page Header section and they have the Can Grow option. I want to be able to align the cells in this row to the bottom and when  any of the cells grow the