Multi-date range within single report

I'm hoping you all find this a very basic question.  I have two columns of data which I want to review for 2 different time periods on the same report.  In this case I am looking at individuals scores in two performance metrics for the prior 6 weeks and then for the current week.  I would like to have the 4 culumns total displayed side by side for each individual.  I hope I am making sense.  Can anyone give me some guidance on this?
Nevermind, My late night brain forgot about dual-query reports and I was able to do just what I wanted.
Edited by: Sarah Negovetich on Aug 7, 2008 11:28 PM

Yet another method...
<cfset start_date = DateFormat('01/01/2007',
'mm/dd/yyyy')>
<cfset end_date = DateFormat('09/30/2009',
'mm/dd/yyyy')>
<cfset start_year = DatePart('yyyy', start_date)>
<cfset end_year = DatePart('yyyy', end_date)>
<cfset schoolyear_start = '09/01/'>
<cfset schoolyear_end = '06/30/'>
<cfset count = 0>
<cfloop index="rec" from="#start_year#"
to="#end_year#">
<cfset tmp_start = DateFormat('#schoolyear_start##rec#',
'mm/dd/yyyy')>
<cfset tmp_end = DateFormat('#schoolyear_end##rec + 1#',
'mm/dd/yyyy')>
<cfif DateCompare(tmp_start,start_date) gt -1 and
DateCompare(tmp_end, end_date) eq -1>
<cfset count = count + 1>
</cfif>
</cfloop>
<cfoutput>
<br>There are #count# school year periods between
#start_date# and #end_date#
</cfoutput>

Similar Messages

  • Can we combine multiple data sources in single report?

    <span style="font-size: 10pt; font-family: Verdana">Can we combine multiple data sources in single report?</span>

    If you can&#39;t do this at the Metalayer (BVs or Universe) - then subreports and shared variables are the method for CR to use multiple datasources in the same report.

  • Obtaining data within a date range in XL Reporter

    Dear All,
    I'm currently working on BS in XL reporter.
    I was trying to extracting data in a date range, setting PER( Code >= @MthFrom Or Code <= @MthTo ) in report default tab.
    However, the result is shown as all data as of current date. E.g. Selection criteria: >=200808, <=200809, the result is shown as from Begining to 200810.
    Please kindly advise.
    Thank you.
    Regards,
    Julie
    Edited by: Julie Wan on Oct 1, 2008 1:10 PM

    Dear Gordon,
    Thank you for your reply.
    However my case is different to your given link.
    In my case, there is a result coming out, but not within the correct range i selected. It shows all instead.
    I tried to set the period range in report default tab,  in column tab of a expanding column, and in cell tab of an individual cell, but none have worked. E.g. PER( Code >= @MthFrom or Code <= @MthTo )
    Regards,
    Julie

  • Supress details in subreport based on date ranges in main report

    I am using Crystal XI R2 and am working with Human Resources Data.
    The main report is grouped on and generates a list of temporary teaching positions like this:
    Smith, John
         FTE_____Start Date_______End Date
          .3 ______09/01/2007______10/20/2007
          .2 ______10/05/2007 ______04/15/2008
          .2 ______04/01/2008 ______06/30/2008
    The subreport (generated from a different source, but linked to main report on ) generates a list of days the employee worked as a Teacher on Call:
         TOC Date______ Portion of Day Worked
         09/05/2007______1.0
         09/19/2007______0.6
         10/08/2007______0.4
         10/09/2007______1.0
          04/08/2008______0.6
          04/18/2008______1.0
    Employees are granted seniority for TOC days worked, EXCEPT when they are already employed in a Teaching position >=.4 FTE  (because they are already granted full seniority for that period), so I need to be able to suppress records that fall within date ranges listed in the Main Report where the combine FTE is >=.4.     
    I believe this question has two parts:
    1. how do I evaluate the date ranges to combine overlapping periods?  Results would look like this... (I don't need to be able to see this, but I'm assuming I'd have to create a date range with the results in order to answer question #2 - but I haven't worked much with ranges.)
        FTE_____Start Date______End Date
          .3______09/01/2007______10/04/2007
          .5______10/05/2007______10/20/2007 
          .2______10/21/2007______03/31/2008
          .4______04/01/2008______04/15/2008
          .2______04/16/2008______06/30/2008
    2. how do I supress the TOC dates in the Subreport that fall within the start and end dates of all the employee's positions >= 0.4 FTE ?  Supreport results for this example would look like this...
         TOC Date______ Portion of Day Worked
         09/05/2007______1.0
         09/19/2007______0.6
         04/18/2008______1.0
    (I will sum the "portion" values and mulitply them by a constant variable to complete the seniority calculation.)
    Thank you in advance for any assistance you may be able to provide!

    Thanks for your help Graham, I have continued to work with this and I took the BO Crystal III course.  Your suggestions gave me a sense of  direction.
    I was not able to share a date range array with the subreport (kept getting error messages saying "call BO" , but I WAS able to share the startdate array and the enddate array.  I also shared the fte values array. 
    I had wanted to use a loop  to check
    if TOCdate in startarray[x] to endarray[x]
    then ftearray[x]
    and  sum the new range of fte[x] values so that I could suppress any TOCdates where fte was >=0.4.   But I couldn't quite get there, I kept coming up with formulas that displayed only the first value or the last or zero.
    So I used the following formula for each index (returnindex value had to be changed for each case), then added them all together.
    shared datevar array startArray;
    shared datevar array endArray;
    shared numbervar array FTEArray;
    local numbervar arraylength:= ubound(startArray);
    local numbervar i;
    local numbervar returnindex :=-1;
    If arraylength >=1 then
    if not({AAATDDET.Date} in startarray[1]to endarray[1])then
    0 else
    if {AAATDDET.Date} in startarray[1]to endarray[1] then
    (returnIndex:= i;);
    i:=i+1;
    if returnindex =0 then
    ftearray[1]

  • Rolling up data into a single report, CRMOD just cannot do it?

    So far as I've learnt, CRMOD is unable to do reports such as this and I'm hoping someone will correct me as I find it to be quite a crippling deficiency in terms of flexibility in delivery reports that clients want.
    Take this example of an ERD:
    http://img215.imageshack.us/img215/1574/erdg.jpg
    Portfolio would be a Custom Object 1, Account Allocation and Financial Info would be Custom Object 4 and 5 let's say.
    Portfolio to Account Allocation is a many-to-many relationship, hence the intermediate Account Allocation object which also has fields of its own.
    As far as I know, I will not be able to report on, an aggregate of all the financial info (e.g. SUM of a currency field in Financial Info) of all the accounts associated to a portfolio. Because of the way CRMOD reports tries to make a link between ALL objects in a single report, putting all 4 together won't work since Financial Info is not in any way linked directly to Portfolio or Account Allocation.
    I know I can link Portfolio to Account Allocation and Account (with the metric from Account Allocation), but then I cannot bring in Financial Info at the same time.

    I am aware of the Portfolio object in the GWM vertical, I was just using it as an example entity to show how the relationships are. :)
    I've used Combined Analysis many times before, but it will not help for a situation like this.
    But yeah, just seeing if any new workarounds to this have come up recently. Personally I find this to be one of the biggest deficiencies with the CRMOD reporting engine.
    It would be great if they would just provide an option to write Oracle PL/SQL code to pull data out from tables ourselves sometimes, then we can specify our own INNER/OUTER joins haha. :D

  • Date ranges in sub reports

    I have a Crystal XI report pulling physician information by type of case (MS-DRG) for 6 months of discharges.  The report looks at cases and average length of stay for each physicians top 5 MS-DRGs.  I built a sub report to pull cases and average length of stay for ALL OTHER physicians for the same 5 MS-DRGs.  The goal is for each physician to be able to benchmark their average length of stay with other physicians in the same hospital.  This report will be accessed at the hospitals through Crystal Enterprise InfoView.  In InfoView, I can only see one set of filters instead of one for the main report and one for the sub report, so the end-users can't change the sub report select criteria.  Therefore, I need the parameters passed from the main report.  I can get everything to work except the discharge date range since the link creates and equal link.  We store our dates in number fields in the format YYYYMMDD.
    How can I get the sub report to run for the same date range as the main report?

    1.  I linked on the hospital ID field, but no date field because I don't want an equal join, I want a range of dates.
    2.  Yes, I want the main report and the sub report to use the same range of dates.
    3.  I didn't create additional parameters in the sub report or main report.  The only parameters being used are those created from the linking of the hospital ID. 
    Thanks.

  • Specifying a Date Range for Interactive Reports

    Hi All,
    I'm currently working on Oracle Application Express 11. We have created an application with a standard reports page. On this page there are the following items:
    HTML Region 1: (Parameters)
    Start Date: (Date Picker)
    End Date: (Date Picker)
    Amount: (Displays Read-Only Amount)
    HTML Region 2: (Specify Report)
    Violation Reports (link 1)
    Correct Reports (link 2)
    Fault Reports (link 3)
    All Reports (link 4)
    I would like to know if it's possible that I could enforce the following scenarios on a user:
    If a user clicks a link without specifying a date range, then an error message is displayed prompting the user to specify Start Date & End Date.
    If a user specifies a Start Date that is outside the table's date range, then an error message is displayed prompting the user to enter a valid Start Date. For instance, if the first ever date on the database table is 17/JUL/97 then if a user specifies 16/JUL/97 as his/her Start Date then an error message will be displayed prompting the user to specify a start date from 17/JUL/97 onwards.
    Is this possible? Please advice!
    THANK YOU IN ADVANCE
    Kamo

    Hi Kamo,
    In order for the dates to be used on the reports (which is what I assume you are trying to do?), the user must submit the page to get the dates into the session. Given that, you could have Validation on your page that checks the criteria you need when the page is submitted. You could also have your Region 2 conditional on the dates not being NULL - that way, the user can not click on a link until both dates have been entered and submitted.
    Andy

  • Using Parameter Date Range Values in Report

    Post Author: rsteeg
    CA Forum: General
    i would like to include the selected start and end dates on my report to display the range of the report.  I cannot recall how to do it.  Can any one help?  I am using CR X.

    Post Author: Crystal Fire
    CA Forum: General
    "All Dates Between "+ ToText(Minimum({?Your Date Field}),"M/d/yyyy")" and "ToText(Maximum({?Your Date Field}),"M/d/yyyy")

  • Date Range Within a Date Range

    I'm suffering from a mental block on this one and I'm hoping
    someone here can help. What I need to do is determine how many date
    ranges are between a broader date range. For example a school year
    runs from 9/1 to 6/30 or 180 work days. What I need to do is
    compute the number of 9/1 to 6/30 periods between say 1/1/2007 and
    9/30/2009. The result of this find is used in othere calculations
    in a rather complex report. Any help is appreciated.

    Yet another method...
    <cfset start_date = DateFormat('01/01/2007',
    'mm/dd/yyyy')>
    <cfset end_date = DateFormat('09/30/2009',
    'mm/dd/yyyy')>
    <cfset start_year = DatePart('yyyy', start_date)>
    <cfset end_year = DatePart('yyyy', end_date)>
    <cfset schoolyear_start = '09/01/'>
    <cfset schoolyear_end = '06/30/'>
    <cfset count = 0>
    <cfloop index="rec" from="#start_year#"
    to="#end_year#">
    <cfset tmp_start = DateFormat('#schoolyear_start##rec#',
    'mm/dd/yyyy')>
    <cfset tmp_end = DateFormat('#schoolyear_end##rec + 1#',
    'mm/dd/yyyy')>
    <cfif DateCompare(tmp_start,start_date) gt -1 and
    DateCompare(tmp_end, end_date) eq -1>
    <cfset count = count + 1>
    </cfif>
    </cfloop>
    <cfoutput>
    <br>There are #count# school year periods between
    #start_date# and #end_date#
    </cfoutput>

  • Passing the Date range within the query

    Hi ,
    In my query , I have two date characteristic, and while doing the selection I have to do selection on only one date field.
    This selection is a date range selection , So I have used a selection variable for this.
    Can anyone please let me know if it is possible to pass the selection range to other variable. Is it possible to use Customer exit to pass the complete range.
    Thanks
    Altair

    Hi,
    You can do it in the user exit.And that is the only approach to transfer the values of one variable to other variable .
    Search this forum for the code. you will find  lot of postings.
    With rgds,
    Anil Kumar Sharma .P

  • Retrieving Freezed and Unfreezed data from a Single Report

    Dear All,
    I have a requirement where we have 2 types of users.
    1. End User and 2. Super User 3. Intermediate Users
    We have source system data which will be retieved on a daily basis.
    Here Super user freeze the data ramdomly.
    We need a report to be generated which with show
    1.Freezed data to Super user
    2. Unfreezed data to End User and
    3. Intermediate User who needs both freezed and unfreezed data.
    Can someone suggest the most optimal way to execute this requirement.
    Early response will be appreciable.
    Thanks,
    Sai Gautam

    Hi,
    you could use the scheduling function of BOE for this.
    For the Super Users: The Report will be scheduled after the data has been frezzed
    For the End Users: They can run the Report On- Demand on any Time
    For Intermediate Users: They can do both. View the Instance of the Scheduled Report and run the Report On- Demand
    This could be handled by Permissions in BOE.
    Regards
    -Seb.

  • Display a count of data in a single report table based on date

    Hello, I need a report that will display the name of the SOURCES, and compare the number of sources received TODAY and YESTERDAY
    My table CELLS holds the name of the SOURCE, and their SAMPLED_DATE so I need to distinguish how many I reveived today and yesterdat.
    eg.
    SOURCE|TODAY|YESTERDAY
    A | 10 |8
    B | 7 |4
    I am thinking of something like the below:
    SELECT DISTINCT source, COUNT(source) TODAY, COUNT(CASE
    WHEN sampled_date = TO_CHAR(SYSDATE-1, 'DD/MM/YY')
    THEN 1 END) YESTERDAY
    FROM cells
    WHERE sampled_date = TO_CHAR(SYSDATE, 'DD/MM/YY')
    GROUP BY.... CUBE
    Any help will be much appreciated.

    drbiloukos wrote:
    Hello, I need a report that will display the name of the SOURCES, and compare the number of sources received TODAY and YESTERDAY
    My table CELLS holds the name of the SOURCE, and their SAMPLED_DATE so I need to distinguish how many I reveived today and yesterdat.
    eg.
    SOURCE|TODAY|YESTERDAY
    A | 10 |8
    B | 7 |4
    I am thinking of something like the below:
    SELECT DISTINCT source, COUNT(source) TODAY, COUNT(CASE
    WHEN sampled_date = TO_CHAR(SYSDATE-1, 'DD/MM/YY')
    THEN 1 END) YESTERDAY
    FROM cells
    WHERE sampled_date = TO_CHAR(SYSDATE, 'DD/MM/YY')
    GROUP BY.... CUBE
    Any help will be much appreciated.Regardless of your final solution, if "sampled_date" is a character string, I'd convert it to a DATE (use TO_DATE) to compare against SYSDATE, rather than convert SYSDATE to a string for the comparison.

  • Devolped an ALV report for daily cash receipts for selected date range

    hi,   
                 how to devlop an ALV report for daily cash receipts for selected date range.for this report what are the tables and fields we have to use.what is the selectionscreen&what is logic.give me sample report.

    hi,   
                 how to devlop an ALV report for daily cash receipts for selected date range.for this report what are the tables and fields we have to use.what is the selectionscreen&what is logic.give me sample report.

  • Devloped an ALV report for daily cash receipts for selected date range

    hi,   
                 how to devlop an ALV report for daily cash receipts for selected date range.for this report what are the tables and fields we have to use.what is the selectionscreen&what is logic.give me sample report.

    Hi,
    You can develop simple reports using Report Painter.
    You may be also interested in:
    Check report SAPMF05A for credit memo
    See the following Std reports on Payment Advices execute the Tcodes:
    S_ALR_87009888
    S_ALR_87009889
    S_ALR_87009890
    S_ALR_87009891
    S_ALR_87009892
    S_ALR_87009893
    S_ALR_87009978
    S_ALR_87009979
    S_ALR_87009980
    S_ALR_87009981
    S_ALR_87009982
    S_ALR_87009983
    S_ALR_87010056
    S_ALR_87010057
    S_ALR_87010058
    S_ALR_87010059
    S_ALR_87010060
    S_ALR_87010061
    S_ALR_87010066
    S_ALR_87010067
    S_ALR_87012106
    S_ALR_87012107
    S_ALR_87012108
    S_ALR_87012109
    S_ALR_87012110
    S_ALR_87012111
    S_ALR_87012116
    S_ALR_87012117
    S_ALR_87012200
    S_ALR_87012201
    S_ALR_87012202
    S_ALR_870122
    S_ALR_87012204
    S_ALR_87012205
    S_ALR_87012350
    S_ALR_87012351
    S_ALR_87012352
    S_ALR_87012353
    S_ALR_87012354
    S_ALR_87012355
    sample ALV report:
    tables:
    marav. "Table MARA and table MAKT
    Data to be displayed in ALV
    Using the following syntax, REUSE_ALV_FIELDCATALOG_MERGE can auto-
    matically determine the fieldstructure from this source program
    Data:
    begin of imat occurs 100,
    matnr like marav-matnr, "Material number
    maktx like marav-maktx, "Material short text
    matkl like marav-matkl, "Material group (so you can test to make
                            " intermediate sums)
    ntgew like marav-ntgew, "Net weight, numeric field (so you can test to
                            "make sums)
    gewei like marav-gewei, "weight unit (just to be complete)
    end of imat.
    Other data needed
    field to store report name
    data i_repid like sy-repid.
    field to check table length
    data i_lines like sy-tabix.
    Data for ALV display
    TYPE-POOLS: SLIS.
    data int_fcat type SLIS_T_FIELDCAT_ALV.
    select-options:
    s_matnr for marav-matnr matchcode object MAT1.
    start-of-selection.
    read data into table imat
      select * from marav
      into corresponding fields of table imat
      where
      matnr in s_matnr.
    end-of-selection.
    Now, we start with ALV
    To use ALV, we need a DDIC-structure or a thing called Fieldcatalogue.
    The fieldcatalouge can be generated by FUNCTION
    'REUSE_ALV_FIELDCATALOG_MERGE' from an internal table from any
    report source, including this report.
    The only problem one might have is that the report and table names
    need to be in capital letters. (I had it )
    Store report name
    i_repid = sy-repid.
    Create Fieldcatalogue from internal table
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
           EXPORTING
                I_PROGRAM_NAME         = sy-repid
                I_INTERNAL_TABNAME     = 'IMAT'  "capital letters!
                I_INCLNAME             = sy-repid
           CHANGING
                CT_FIELDCAT            = int_fcat
           EXCEPTIONS
                INCONSISTENT_INTERFACE = 1
                PROGRAM_ERROR          = 2
                OTHERS                 = 3.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                I_CALLBACK_PROGRAM       = i_repid
                I_STRUCTURE_NAME         = 'marav'
                I_DEFAULT                = 'X'
                I_SAVE                   = 'A'
           TABLES
                T_OUTTAB                 = imat.
      IF SY-SUBRC <> 0.
        WRITE: 'SY-SUBRC: ', SY-SUBRC .
      ENDIF.
    Hope this will help.
    Regards,
    Naveen.

  • Report that Forces a User to Input a Date Range

    Greetings,
    I am generating a work times report and would like to force the user to select a date range when the report first opens. This would pull only the data for the specified range from my database.
    I prefer drop down lists or calendars, but am wondering if this is possible.
    I guess one other important element is that I would like to "dumb down" the interface, so the user of the report does not have access to all of the features of the program.  Basically I only want them to have read privileges.
    I'm new to CR, so would appreciate any guidance.
    Thanks
    Peter

    Here is what the Help system has to say about the read only feature:
    You can make a report, section, area, or object read-only so it can't be formatted.
    When you set this option, choices in the Format Editor become inactive.
    The formatting options that are usually available on the toolbars or shortcut menus are also suppressed for the report or object.
    Note:    This feature is for your convenience in protecting report formatting; it is not intended to be used as report security.
    Also, if you want the user to be prompted for parameter values each time they open the report, take the check mark out of the
    "Save Data with Report" option.
    Jason

Maybe you are looking for