How to create a loop to run total of records for before and after unconstant date

Post Author: Ann2
CA Forum: Formula
Here is the data sample:
ID period code date
1  00  I    01/01/1999
1 00   Z   01/02/1999
1 00  G   12/05/1999
1 00  M   01/01/2000
There are many students with many periods and many codes. I need to save a date when code = 'G' and count separateley records per student/period 2 times - before and equal that date and after that date, so in the end for period 00 I will have 2 values: 3 (before) and 1(after).
There are periods from 00 to 08. I am counting students abscencies before and after warning letter was sent (code G).
The result data should look : 00 01 02 03 04 05 06  07  08              00 01 02 03 04 05 06  07  08     Total
                                            3  0   0   0   0   0   0   0   0                 1 0    0   0   0   0   0   0   0        4
Please help me.
Thank you.
Ann2

Post Author: Ann2
CA Forum: Formula
Thank you for your answer, but I do care about the date the 'G' happened, because I need to reset count.
The logic behind is this:if a student absent for more than 8 times per period - the letter will be sent out to the parents , that will be code 'G' with period '-1' (it may happen that there will never be code 'G' , but I need to track all absencies). Once the letter is sent, the count starts over (the count starts over the next day after code 'G'). The absencies which happened before or the date the letter sent should count toward 'previous'  abscenices, all other - absenices after the letter.
So basically I need total per period and total per period before or the day with code 'G'.  Running total with reset with formula code = 'G' does not work.
I created a formula field which has global date (when code 'G' happenned) and it says if globaldate >= periodDate then date (1900,01,01) else (2100,01,01) and that formula is ok, but I can not use it in running total or can not create group on it and insert total.
Please help me with this. Thank you.
Ann2

Similar Messages

  • PL/SLQ - How to create query with horizontal running totals

    Hi:
    I'm trying to create a report in the following format
    Year Name Reg1 Reg2 Reg3
    2001 Al 3 4 5
    2001 Le 4 1 1
    2001 7 5 6
    2002 Sue 2 4 1
    2002 Al 1 3 6
    2002 Jim 6 1 3
    2002 16 15 16
    2003 Jim 4 -3 2
    2003 Le -2 4 5
    2003 20 16 23
    Note that the totals are accumulating horizontally, broken on year. How do I do that, please? Thanks very much!
    Al

    Hi, Al,
    Welcome to the forum!
    978108 wrote:
    Hi:
    I'm trying to create a report in the following format
    Year Name Reg1 Reg2 Reg3
    2001 Al 3 4 5
    2001 Le 4 1 1
    2001 7 5 6
    2002 Sue 2 4 1
    2002 Al 1 3 6
    2002 Jim 6 1 3
    2002 16 15 16
    2003 Jim 4 -3 2
    2003 Le -2 4 5
    2003 20 16 23 You may have noticed that this site normally doesn't display multiple spaces in a row.
    Whenever you post formatted text (such as query results) on this site, type these 6 characters:
    \(small letters only, inside curly brackets) before and after each section of formatted text, to preserve spacing.
    If you do that, your desired output will be much more readable:Year Name Reg1 Reg2 Reg3
    2001 Al 3 4 5
    2001 Le 4 1 1
    2001 7 5 6
    2002 Sue 2 4 1
    2002 Al 1 3 6
    2002 Jim 6 1 3
    2002 16 15 16
    2003 Jim 4 -3 2
    2003 Le -2 4 5
    2003 20 16 23
    Note that the totals are accumulating horizontally, broken on year. How do I do that, please? Thanks very much!
    AlHere's one way to do that:WITH     yearly_summary     AS
         SELECT     year
         ,     SUM (SUM (reg1)) OVER (ORDER BY year)     AS reg1
         ,     SUM (SUM (reg2)) OVER (ORDER BY year)     AS reg2
         ,     SUM (SUM (reg3)) OVER (ORDER BY year)     AS reg3
         FROM     table_x
         GROUP BY year
    SELECT     year, name, reg1, reg2, reg3
    FROM     table_x
    UNION
    SELECT     year, NULL, reg1, reg2, reg3
    FROM     yearly_summary
    ORDER BY year, name
    Edited by: Frank Kulash on Dec 20, 2012 3:04 PM
    Corrected query.
    Whenever you have a problem, please post CREATE TABLE and INSERT statements for your sample data.  For example:CREATE TABLE     table_x
    ( year     NUMBER
    , name     VARCHAR2 (10)
    , reg1     NUMBER
    , reg2     NUMBER
    , reg3     NUMBER
    INSERT INTO table_x (year, name, reg1, reg2, reg3) VALUES (2001, 'Al', 3, 4, 5);
    INSERT INTO table_x (year, name, reg1, reg2, reg3) VALUES (2001, 'Le', 4, 1, 1);
    INSERT INTO table_x (year, name, reg1, reg2, reg3) VALUES (2002, 'Sue', 2, 4, 1);
    INSERT INTO table_x (year, name, reg1, reg2, reg3) VALUES (2002, 'Al', 1, 3, 6);
    INSERT INTO table_x (year, name, reg1, reg2, reg3) VALUES (2002, 'Jim', 6, 1, 3);
    INSERT INTO table_x (year, name, reg1, reg2, reg3) VALUES (2003, 'Jim', 4,-3, 2);
    INSERT INTO table_x (year, name, reg1, reg2, reg3) VALUES (2003, 'Le', -2, 4, 5);
    Also, say which version of Oracle you're using.  In this case, it may not matter.  The query above will work in Oracle 9.1 and higher.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How do I extract a substring when I know what become before and after it

    I am able to get the HTML source of a web page and I want to get certain information from it.
    I am trying to extract a 1 or 2 digit number but sometimes it is not there but I know that this comes exactly before the number if it exists or not
    "</td>
         <td class="alt1">"
    Which translates to regex as "</td>\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t<td class=\"alt1\">" Then the number appears just after the "<td class="alt1">" and I want to automatically say its 0 if its not there.
    How easy is it to extract that number?

    Normally I would be happy to help you, but after several years of trying to help here, I've decided not to contribute anymore because of the piss-poor way in which this site is being administered.
    Others are still helping, but more may leave if things don't improve. May I recommend devshed or javaranch?
    http://www.devshed.com/
    http://www.javaranch.com/
    If you would like to complain to the admins of this forum, either click the "Report Abuse" link or the "Feedback" link.
    The forum denizen formerly known as [url http://forum.java.sun.com/profile.jspa?userID=2959]jverd

  • How to create transparent image at run-time?

    How to create transparent image at run-time? I mean I want to create a (new) transparent image1, then show other (loaded) transparent image2 to image1, then show image1 to a DC. The problem is - image1 has non-transparent background...

    i'm not sure, but you can set the alpha value to 0 in all pixels which are 'in' the background..
    greetz
    chris

  • How to create po through batch run

    Hi,
    how to create po through batch run (through background job)
    Prashanth

    Hi Prashanth ,
    Run the below program as a background job.
    Make sure that inforecord exists for all and automatic PO are ticked in Vendor and Material Master.
    Program : RM06BB30
    Create a suitable variant.
    Job Creation : Tcode : SM36
    Regards
    Ramesh Ch

  • How to created a Report to calculate On-Hand inventory for pending sales

    hi,
        how to  created a Report to calculate On-Hand inventory for pending sales orders.for this report what are the tables and fields we have to use give me sample report.
    thank you
    radhakrishna.

    Hi!
    Tables:
    VBAK - sales order header data
    VBAP - sales order position data
    VBUK - sales order status header data
    VBUP - sales order status position data
    VBELN field is the key between the tables.
    Statuses in tables VBUK, VBUP: A-uncompleted, B-partially completed, C-fully completed
    Regards
    Tamá

  • How to create a custom function module with the records in SAP R/3?

    Hi All,
    How to create a custom function module with the records in SAP R/3? Using RFC Adapter I have to fetch the custom function module records.
    Regards
    Sara

    Hi
    goto se37...here u need to create a function group... then u need to create a function module. inside assign import/export parameters. assign tables/exceptions. activate the same. now write ur code within the function module
    http://help.sap.com/saphelp_nw04/helpdata/en/9f/db98fc35c111d1829f0000e829fbfe/content.htm
    Look at the below SAP HELP links, These links will show you the way to create a Function Module
    http://help.sap.com/saphelp_nw04/helpdata/en/26/64f623fa8911d386e70000e82011b8/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/9f/db98fc35c111d1829f0000e829fbfe/content.htm

  • How do I create a form that will give a report that summarises before and after data on the same graph?

    I have a number questions that I want to know the average of all the before and after data to compare them, how do I set this up in a form in FormsCentral?  Here is an example of what I want to do - the green bar is "before" and blue is "after"

    This isn't something that you can set up in FormsCentral. It's possible to something similar with a form you create in Acrobat and use with FormsCentral, but there is no sort of built-in graphing control. The bar graph could be implemented with some JavaScript that controls annotations or fields (buttons) and perhaps some text fields.

  • How to create iTune or App Store without credit card for my existing Apple ID without create new Apple ID or email?

    I got 2 Apple ID and the first time to I use it to iTune or App Store, a box will pop out and telling me this:
    "This Apple ID has not yet been used with the i Tunes Store. Please review your account information."
    Then, I click on the button, "Review". Bla bla... but ended up, I must provide a credit card in order to complete it.
    I do not have credit card, so I search 'How to create iTune or App Store without credit card', same link and same tactic only valid for New Apple ID.
    So, it seem no other option to create iTune or App Store without credit card for existing Apple ID, right?

    The same thing is happening to me!

  • How to create a sub head(code) in a catalog- for service notification

    Hi everyone,
    How to create a sub head(code) in a catalog- for service notification?
    Please guide with your valuable comments.
    Please guide its very urgent.
    Thanks and Regards
    Edited by: MPVash Vash on Oct 24, 2008 8:14 AM
    Edited by: MPVash Vash on Oct 30, 2008 7:38 AM

    Hi,
    Go to T-code QS41, give the catalog and code group and enter.
    U can click on the code after selecting the code group and create new  codes.
    In SPRO u should see which type of catalog is assigned to the notification type. This u can see in the overview of the notification type by selecting the notification type in SPRO.
    Regards
    Haricharan

  • How to create a ABAP report off of SRM box for live data?

    How to create a ABAP report off of SRM box for live data?
    Thanks in advance.
    York.

    you can try infoset query:
    STEP - A:
    1. Go to T Code RSQ02 and give the InfoSet name & select CREATE.
    2. Provide the Name(Description) and Data Source i.e. for eg here i take "DIRECT READ OF TABLE" = /BIC/AODS100. Then CONTINUE.
    3. Select what to Include in the 3 options available with the POPUP, here "INCLUDE ALL TABLE FIELDS". Then Check the fields and click GENERATE(one RED and WHITE round icon).
    4. Now provide the PACKAGE for the INFOSET. Come Back(F3).
    STEP - B: optional(If u want to create a new user group)
    1. Select ENVIRONMENT -> USER GROUPS. Provide the User Group name and CREATE.
    2. Provide Description and SAVE.
    3. Provide PACKAGE and SAVE. Come Back (F3) to the Initial Screen.
    4. Click Role/User Group Assignment. Select Newly Created User Group or an existing one. Then SAVE (CTRL + S). F3.
    STEP - C:
    1. Select ENVIRONMENT -> Queries. Provide the query name and CREATE.
    2. Select the INFOSET u have created and assigned the user group.
    3. Provide the Title and Select BASIC LIST. There you have to select (check) the fields you want to display, SAVE and then TEST. It will ask for Variant, just CONTINUE.

  • 5.2 Pages, how to create white space before and after paragraphs?

    Hi everyone,
    I'm having a very frustrating time with the new 5.2 version of pages after upgrading from a prior version. In the previous version, you could easily adjust the exact amount of white space before and after each paragraph. You were able to do this from within the inspector, but for the life of me, I cannot find it ANYWHERE in the new version and I'm ripping my hair out trying to find it.
    Surely you must be able to control the amount of space before and after each paragraph? It's totally useless to me if I can't; I want to be able to format my documents how I want; ie. plenty of white space between paragraphs and list points, not all bunched up together.
    Someone please help me! Thank you so much!

    Try telling Apple that. Start by rating/reviewing Pages in the App Store.
    I have been told repeatedly by Apple staff that the new User Interface makes it "Much simpler".
    When I ask how? …and point out how many (more) hidden steps there are, they don't want to talk anymore.
    Apple's standard response to just about everything lately, unfortunately.
    btw If you have the choice, use Pages '09 instead. Less buggy and way more features, better laid out.
    Peter

  • How to create an activity when system finds duplicate record!!

    Hi CRM Experts,
    I am working on CRM 5.0. We are uploading contact details to CRM through ELM.
    Here My queries are:
    1) How to create An Activity when system finds duplicate record?
    2) By using ELM we can create BP with Activities and BP with Leads. But Here, my scenario is we have to Create BP with leads and Acivities. can any one help me on these areas?
    Thank in Advance.
    Sree

    Hi Sree,
    I can help you with your first query.
    When the system finds a duplicate record then either the system stops working further or proceeds with the error free record.
    So once the duplicate entry is found only the first record will be considered and not the second or the duplicate record.
    Regards,
    Rekha Dadwal
    Kindly reward with points if usefull !!!!

  • Space before and after totals

    Hi Experts,
    I am developing a Revenue & COGS report. As part of the same, user wants to have Subtotal for Revenue & Expenses accounts and a Total to represent the Gross profit.
    He needs one empty row after all Revenue accounts, followed by Total Revenue, then again an empty row ... same for expenses too.  This is dynamic report.
    I tried using a local member but when the report is changed, the empty line disappears.
    I also tried "EPM function - Insert before and after" but that is also not working... I am also not sure of how to use this function.
    Please advise.
    Thanks,
    Subbu.

    Yes you are correct Vadim
    @Subbu,
    please try below
    Before:  create a Local member "insert Before" and attached  to member "total revenue account"
    After:  create a Local member "insert After" and attached to member "total revenue account"
    Please check the sample screenshot
    if totals are local members then select attached to as "Local member"
    Thanks,
    Dinesh.V

  • In my class i am suppose to do a before and after shot, how do i have two photos on one page

    before and after shots..how do i put two photos on one page?? please help

    Good day!
    As Photoshop is not a page layout application but primarily image editing software the concept of "page" has limited relevance.
    Anyway, you could increase the canvas (Image > Canvas Size) and place the other image (File > Place …) or drag and drop it.
    Or create a new image and place both images. Whether doing so as Embedded or Linked Smart Objects makes more sense depends on your workflow, I guess.
    File > Automate > Contact Sheet II would be another option.
    Regards,
    Pfaffenbichler

Maybe you are looking for

  • Using ACLs With iPlanet 4.1

    Hello, I hope somebody can shed some light on the following: I'm using iPlanet 4.1 on a UN*X box, and I need to restrict access to some web assets it serves. I read through the iPlanet administrator docs and learn't that it has access control built i

  • After working fine for over a year, 160 quits working and goes into recover

    So, I've had my 160gb iPod for awhile, and it has basically worked fine for a while. Occasionally, it skips, but I just said whatever, and let it be. Anyway, today I listened to it frequently, and it started to take about 15 seconds to actually start

  • My account is saying it can't connect - I know I have new emails but they're not showing in my inbox

    My account is saying it can't connect - I know I have new emails but they're not showing in my inbox. Thank you

  • Email Activity dispatch exception

    I am trying to send email in a BPEL process, I am getting the following exception (in simple bpel process the email activity is working fine) <2008-08-12 13:12:10,137> <ERROR> <default.collaxa.cube.engine.dispatch> <BaseScheduledWorker::process> Fail

  • DB Deployment failed in planning

    Hi: I installed Essbase and configured and tested and everything is ok. I installed Hyperion planning and when I tried to configure the database through configuration utility, I get the following error. (Oct 12, 2008, 11:28:55 AM), com.hyperion.cis.c