Modifying the report total

Hi,
I want to the total row on a report not to be automatically summarized, but processed by my own algorithm.
In one row I divide two numbers e.g: 10/5 = 2
in the second row I divide e.g.: 20/5 = 4
but in the total row I want to bee seen not 6 but 30/10 = 3
Any idea?
Regards,
Balazs

According to this article http://www.cs.tut.fi/~jkorpela/html/nobr.html this is a known wrapping issue with Internet Explorer. Wrapping will occure when the following characters exists -()[]{}«»%°·\/!?. The author of the article suggest that the only way around this issue is too place -a or use white-space:nowrap in a [td] or [tr] tag.
This would suugest that I need to find a way to add html to the total column in the htmldb report . . . which I don't believe I can do . . . Does anyone know of a way to insert html into these total columns similiar to how we can be done using the CCS Style or HTML Expression attributes.
Thanks,
David.

Similar Messages

  • Report hanging (when try to modify the report)

    Post Author: aneel
    CA Forum: WebIntelligence Reporting
    Hi All,
    This becomes a longlosting issue for me Please anyone look into this.
    I have created one report with 6 global and 3 local filters, 12 local variables.
    When I try to modify the webi report it strucks up and keeps on running continuously with out giving any kind of result.
    Please reply anyone !!!!!!!!!

    Post Author: jsanzone
    CA Forum: WebIntelligence Reporting
    Vinl,
    The WebI (and BOE XI server) is not completely tuned out of the box to support multiple data providers and large data sets.  There are tuning parameters that must be set (and which will cause more memory usage, etc, etc) and must be monitored to expand performance in order to resolve unwanted timeouts.  If you are not the administrator, then you'll have to work with him or her (and possibly open a trouble ticket with tech support for more help, if needed).
    The timeout aspect is frustrating.  We have three servers, development, testing, and production.  The development system is totally off-line and not under any security-lockdown influences.  Testing is our pre-stage and was built by our BI team.  And production is in the server farm built by the Sysadmins.  Of the three servers, only the production server suffers from a two-minute WebI timeout (and Infoview timeouts where the report just spins all day without a response, but in WebI at least we get an ugly "error notice" when the two-minute timeout occurs).  We think that some kind of lockdown was performed on our production server that causes the two-minute timeout for an executing report to occur.  On the one hand it keeps us sharp in not building reports that will make the user wait a long time, and to encourage them to schedule a report through scheduler when it will take longer than two minutes to execute.  On the other hand it can be troublesome to maintain a report that takes so long to run in terms of modifications and corrections.  At times I've had to go into the datawarehouse and rename a production table to something else, then create a mini-version of that production table in order to run the report and modify it (all done in the off-hours of course), and then when done modifying the report, delete the mini-version of the production table and rename the off-named production table back to its original name in order to press on.  The things we gotta do to press on with life....  Good luck, and hang in there Vinl.

  • Process/stpes to modify the report painter reports...

    Hi,
        I want to modify the report painter report. Could anybody tell me how can we do this. Where can we do this and it would be helpful if any body advise with the steps.
    The requirement is to add one line in the current report painter report and remove one line from it.
    Regards....

    Hi,
    Modifying a report painter report is very similar to creating the report itself. Below mentioned are the steps in general, please use them as per your requirement.
    From the relevant application, choose Tools->Report Painter->Report->Create.
    The Report Painter: Create Report screen appears.
    You can also create Report Painter reports from any Report Writer screen. To do so, choose Report Writer->Report Painter-> Create report.
    Enter the name of the library the report is to use, and a name and description for the report. The report name can be a maximum of eight characters long. If you want to create your report using an existing Report Painter report as a basis, enter the name of the report that you want to copy under Copy from. Both reports must use the same library.
    Choose Create.The next screen displays an empty report containing four rows and four columns (this is the basic structure for a report). You define your report on this screen.
    Enter or change the description for the report by double-clicking the report description field.
    A dialog box appears in which you can enter a short, medium, and long text for the report description.
    Define the rows of your report.Rows contain a combination of characteristic values or formulas. Note the lead column at the first position of the rows. The Report Painter uses the lead column to access the rows. You can replace the description Lead column with a different term.
    Define the columns of your report. Columns contain a combination of a basic key figure and optional restricting characteristic values. You can also use predefined key figures to present key figures and characteristics that make business sense. For example, a number of predefined key figures are delivered for the libraries in Overhead Cost Controlling that can be copied directly into the reports, where they can be modified as required.
    Define general data selection criteria. The general data selection criteria restrict data selection for the report.
    Choose Save and then Execute to create the report. Assign the report to a report group.
    You have to display the report before you execute it, so that you can later change the report layout directly from the report list. Once you have defined a report, you can display and print out a table of contents with Extras->Overview.
    The overview contains the characteristics and characteristic values used in the individual sections, column blocks, and general data selection criteria. It also provides general information such as the user who last changed the report, the report name, and the standard layout assigned to the report, as well as details on the report formats.
    If you double-click an individual characteristic, you can see where this characteristic is used in the report definition.
    Hope this helps you. Let me know if you need an specific information.
    Rgds
    Manish

  • How to show the break totals and NOT the report totals in an SQL report

    APEX 4.0.1
    In an normal SQL report (Not interactive) with a break applied on the first column, how do you just show the break totals and NOT the extra full report totals?
    Next, Is it possible to display only some of the row totals and not for all columns that have the sum option checked against them?
    PaulP

    PaulP wrote:
    APEX 4.0.1
    In an normal SQL report (Not interactive) with a break applied on the first column, how do you just show the break totals and NOT the extra full report totals?Instead of using the APEX break feature, try doing all of this in the query using <tt>GROUPING SETS</tt> or <tt>ROLLUP</tt> to get the break rows, and <tt>GROUPING_ID</tt> in the <tt>HAVING</tt> clause to suppress the unwanted rows.
    Next, Is it possible to display only some of the row totals and not for all columns that have the sum option checked against them?Don't really understand what's meant here?

  • Problem Modifying the reports

    Hi friends,
    I changed the name of my Business Model in Admin tool.
    Now whenever I'm trying to modify my previous reports, I'm not able to access the columns there and it gives me the following message on the left.
    "Either you do not have permission to use the subject area "ABC" within Answers, or the subject area does not exist."
    Please help

    This is a problem that I believed Oracle fixed with 10.1.3.4.
    In previous versions, you will need to replace the columns. (An alias is created so if there is no change to the design, the reports would run fine. But when you try to make modifications to the design is when the problem occurs.)

  • ME57:  How do I modify the report?

    Hello all,
    I have a requirement to add a field to the output report of ME57, RM06BL00.  I can't find any sort of exit that will allow me to do so.  I would like to add a field next to the stock location field on the report.  Any suggestions? 
    I will of course reward points if a solution is presented.

    Regarding not 65774-
    I have requirement where I need to add two columns on the outputlist of ME57.
    Having found out about note 65774 on the forum I find myself stuck on point 3. under ?OTE:
    It says
    3. Now choose the view 'Lenght of purcahse requisition lists' in customising.
    My question is where in customising do I find this
    I would really been grateful if you could advise me. Have been chasing my own tail fo the last two days.

  • How can I get the second group and report totals in Matrix report?

    Hi,
    I have created a matrix report with 2 break Groups.
    Iam getting columns totals for the first group, but not for the second group and the report totals.
    How can I get the second group and report totals for each month?
    Thanks.
    Ram.

    Hi Ram,
    If you want a total at any group-level, go to the particular group in the data model, insert a summary column in the group, and select
    Reset At > appropriate Group Name
    For report level summaries, you must create the summary column outside of all groups.
    Navneet.

  • Can I change the reort total: text in the summary row in a report region?

    Hi all,
    This might has been asked before, I tried searching the forum but couldn't find an answer. In the report attribute, if I tick the sum checkbox then run the page, the last row would give me the summary numbers which is what I want. However is there a way I can change the "report total" text in the last row of the first column?
    Thanks very much for your time.
    Pete

    Hello user9546327,
    I had the same problem, until I realised that the text seems to be printed under the first column of the report. If that one is a hidden column, the text won't be printed in the report.
    Solution:
    In the 'Report Attributes' tab, move the first visible column (= attribute 'Show' is ticked) to the top of the report columns.
    Best regards,
    Sabine

  • Modifying the SAP standard Report Program RFASLM00

    SAP Standard Report : RFASLM00
    When we execute this program, in the selection screen reporting country field is made mandatory, Now I want to modify the Report to prevent this field being mandatory.

    Go to SE38, type RFASLM00, press to copy button, give the new name starting with Z or Y, rename the includes if you want to edit them else keep them the same..
    In the Selection-Screen against the country field remove the addition OBLIGATORY.

  • Does Classic report provide facility to make report total to be hyperlink

    Hi ,
    Does Classic report in apex provide provision to make the report-total row editable(hyperlinked) ? if so how to implement that.
    Acq     WIP     Closed
    Abc     1     3
    Def     2     5
    report total :     3     8
    Also is it possible to provide more than 2 downloadable options for classic report :
    For eg: now i have provided options to export a report to csv and excel format, along with these two can i provide pdf option!!!!
    Thanks in advance

    You didn't mention what version of Apex you are using. If you are on 4.0, this can be done easily using dynamic actions.
    Here is an example http://apex.oracle.com/pls/apex/f?p=24317:92
    One DA that looks like this http://screencast.com/t/djyAG6F4WFM
    The first TRUE action (fire on page load) changes the cursor style to indicate that the row is clickable http://screencast.com/t/Z3YIXo6c
    The second one actually does the redirect http://screencast.com/t/jHMtyDwK8lM in the example it just shows an alert message but you can modify it to pass in whatever parameters you need and construct the location.href to redirect to.

  • The report options under "configure" and CSV or xls.

    The report options under “configure” does not give .csv or xls as options. Instead of using vi to pass data to database, is there a simple way to transfer all the results (just like the way in the report that automatically generated) to .csv or xls...
      Thanks.

    Hi,
    in order to modify the report generation, you have to understand the way how TestStand works in regard of the report generation.
    There is a tutorial which explains this which you can find here. But please note that the tutorial is currently undergoing an improvement process. 
    The reason that the report options don't give you the option for xls or csv as report is: 
    Neither xls nor csv are predefined. So for example measurement values in xls can be placed in a special worksheet or included in a main sheet in a certain column.
    hope this helps,
    Norbert 
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • Lack of variability in report total in analysis

    First off, sorry if this is a repetitious post.
    But, when creating new applications and building analysis into them at startup, I have found that Oracle adds a row at the bottom titled "report total". The problem is that all this does is add the total of the column. In one case I had a series of averages in my column and would preferred to have a total average at the bottom or no information at all, not a sum of all the averages. I was wondering if there is a way to customize this or even turn it off?

    If none of the columns on the Reports Attributes page have a checkbox in the Sum column the 'report total' line does not appear.

  • How to Suppress Report Total When Using Sum on Columns & Break Formatting

    I need to know how to NOT show the report total line when using the sum functionality with a break in a report.
    I am summing two columns, a debit amount and credit amount. I am breaking on the first column which is the level of a hierarchical query. I want to see something like this:
    Parent Record xxxxxxxxxxxxxx
    Parent Sum $$ $$
    Child Record xxxxxxxxxxxxxx
    Child Record xxxxxxxxxxxxxx
    Child Sum $$ $$
    However, when I run the report, I also get a report total line under the child sum which is really meaningless for this report.
    I have also tried creating this report as an interactive report. When applying the sum on the two columns, I do get the sum totals on the break only - no report total - however, it is reversing the order of the hierarchical query results putting the child records first and the parent records second.
    Thanks in advance for your help.

    Hi, and welcome!
    I don't think that there's an easy way to "switch off" the Total line on a report. The nearest I could suggest would be to either hide the entire row or colour the text so that it's the same as the background - either way, the total is calculated but the user won't see it.
    If you put something like the following into your report region's Region Footer:
    &lt;script type="text/javascript"&gt;
    var outertable = document.getElementById("#REGION_ID#");
    var innertable = outertable.getElementsByTagName("TABLE")[1];
    var rs = innertable.rows;
    var lastrow = rs[rs.length-1];
    if (lastrow.cells[0].innerHTML == '&lt;b&gt;TOTAL&lt;/b&gt;')
    rs[rs.length - 1].style.display = "none";
    &lt;/script&gt;Then, on your report's Report Attributes page, scroll down to the Break Formatting section and put TOTAL into the "Display this text when printing report sums" setting. Also, in the "Layout and Pagination" section, set "Enable Partial Page Refresh" to No.
    The above code is based on the report and region templates that I'm using here: [http://apex.oracle.com/pls/otn/f?p=267:147] (Theme 18, "Report Region" region template and "Standard" report template). Your report may use different templates, so the first two lines on the code may have to change. #REGION_ID# would be replaced with the region's ID value (which would be "R" followed by a long number). As long as you can identify the HTML tag that uses this ID value, you can then get to the actual table that contains the data as it would be a TABLE within that tag - the [1] above is the second table within the region. In some instances, you may have to use "region_#REGION_ID#" as the starting point.
    Andy

  • Change the report type.

    I'm using a report for determine the top applications.
    How can modify the report to get session count and bytes trasmitted on the same report?
    Thanks, and happy new year!
    Andrea.

    Hi Andrea,
    Can you be more specific? From what i have perceived, you want to know the bytes transmitted for each application, rite? If that is your requirement, i am afraid MARS will not fulfill the purpose. For such analysis, you need some netflow analyzer (solarwinds, NFC, Manageengine NTA) will give you in depth analysis, or you can use NBAR on IOS if you have your devices on the IOS that support NBAR...MARS simply uses netflow to detect any anomaly in the traffic patterns,it does not correlate the netflow traffic unlike the syslogs. For flows correlation you have to use any of the NTAs that i mentioned before.
    regards,
    Mohsin

  • SSRS Application to Retrieve Reports from the Report Server

    I have an application that is done using SSRS on visual studio and it connects to the report server on SQL server 2008 environment.
    I've been changing the existing reports using visual studio 2008 and modifying the reports on the report server. How do I add a new report to the application ? I created a new report and deployed it on the report server but it didn't show up in the application.
    I can access the application source code on visual studio 2010 and TFS (Team Foundation). Thanks. 

    Hi, 
    Thanks for the reply. This is a view and [AmountDue] is supposed to be [CurrentDueAmount] + [PastDueAmount] - [PaidAmount]. The view is not calculating [PaidAmount] right . Below is the complete code of the view. Do you see anything wrong in the code ?
    Thanks. 
    SELECT     [isi].[InvoiceID], [ii].[DueDate], [SubInvoiceID] = [isi].[ID], [INV_FacilityID] = [if].[ID], [if].[FacilityID],
    [iff].[FacilityFeeID], [LoanID] = NULL, [isi].[PortfolioID], [isi].[Portfolio], 
                          [PaymentType] = [isis_fee].[SectionType], [Name]
    = [iff].[Name], [ReceivedAmount], [dates].[CurrentDueAmount], 
                          [PastDueAmount] = CASE WHEN ISNULL([ReceivedAmount],
    0) > 0 THEN [pastdue].[PastDueFeeAmount] + ISNULL([ReceivedAmount], 0) 
                          WHEN ISNULL([ReceivedAmount], 0) 
                          < 0 THEN /* We bring past due to zero and
    apply reset to current. */ CASE WHEN [pastdue].[PastDueFeeAmount] + ISNULL([ReceivedAmount], 0) 
                          < 0 THEN 0 ELSE [pastdue].[PastDueFeeAmount]
    + ISNULL([ReceivedAmount], 0) END WHEN ISNULL([ReceivedAmount], 0) = 0 AND 
                          [pastdue].[PastDueFeeAmount] < 0 THEN 0 ELSE
    [pastdue].[PastDueFeeAmount] END, [PaidAmount] = CASE WHEN ISNULL([ReceivedAmount], 0) 
                          < 0 THEN /* We bring past due to zero and
    apply rest to current. */ CASE WHEN [pastdue].[PastDueFeeAmount] + ISNULL([ReceivedAmount], 0) 
                          < 0 THEN - ([pastdue].[PastDueFeeAmount]
    + ISNULL([ReceivedAmount], 0)) ELSE 0 END WHEN ISNULL([ReceivedAmount], 0) = 0 AND 
                          [pastdue].[PastDueFeeAmount] < 0 THEN - [pastdue].[PastDueFeeAmount]
    ELSE 0 END, [AmountDue] = [unpaid].[UnpaidFeeAmount], [ID] = [iff].[FacilityFeeID]
    FROM         [dbo].[INV_SubInvoice] isi JOIN
                          [dbo].[INV_Invoice] ii ON [isi].[InvoiceID]
    = [ii].[ID] JOIN
                          [dbo].[INV_Facility] [if] ON [isi].[ID] = [if].[SubInvoiceID]
    JOIN
                          [dbo].[INV_FacilityFee] iff ON [if].[ID] = [iff].[INV_FacilityID]
    JOIN
                              (SELECT     [sis_fee].[ID],
    [sis_fee].[SectionTypeCode], [SectionType] = [st_fee].[Name], [sis_fee].[INV_FacilityFeeID]
                                FROM      
       [dbo].[INV_SubInvoiceSection] sis_fee JOIN
                   [dbo].[INV_SectionType] st_fee ON [sis_fee].[SectionTypeCode] = [st_fee].[Code]
                                WHERE      [INV_FacilityFeeID]
    IS NOT NULL AND [StatusCode] = 'BILL') isis_fee ON [iff].[ID] = [isis_fee].[INV_FacilityFeeID] JOIN
                              (SELECT     [iffa].[SectionID],
    [AccrualDeterminationDateMax] = MAX([iffa].[AccrualDeterminationDate]), 
                   [AccrualDeterminationDateMin] = MIN([iffa].[AccrualDeterminationDate]), [CurrentDueAmount] = SUM([iffa].[AccruedFeeAmount]), 
                   [ReceivedAmount] = SUM([iffa].[ReceivedFeeAmount])
                                FROM      
       [dbo].[INV_FacilityFeeAccrual] iffa
                                GROUP BY [iffa].[SectionID])
    dates ON [isis_fee].[ID] = [dates].[SectionID] LEFT JOIN
                              (SELECT     *
                                FROM      
       [dbo].[INV_FacilityFeeAccrual]) unpaid ON [dates].[SectionID] = [unpaid].[SectionID] AND 
                          [dates].[AccrualDeterminationDateMax] = [unpaid].[AccrualDeterminationDate]
    LEFT JOIN
                              (SELECT     [SectionID],
    [PastDueFeeAmount] = SUM([PastDueFeeAmount])
                                FROM      
       [dbo].[INV_FacilityFeeAccrual]
                                GROUP BY [SectionID]) pastdue
    ON [dates].[SectionID] = [pastdue].[SectionID]
    UNION
    SELECT     [isi].[InvoiceID], [ii].[DueDate], [SubInvoiceID] = [isi].[ID], [INV_FacilityID] = [if].[ID], [if].[FacilityID],
    [FacilityFeeID] = NULL, [il].[LoanID], [isi].[PortfolioID], [isi].[Portfolio], 
                          [PaymentType] = [isis_loan].[SectionType], [Name]
    = [il].[Name], [ReceivedAmount], [CurrentDueAmount], [PastDueAmount] = CASE WHEN ISNULL([ReceivedAmount], 
                          0) > 0 THEN [PastDueAmount] + ISNULL([ReceivedAmount],
    0) WHEN ISNULL([ReceivedAmount], 0) 
                          < 0 THEN /* We bring past due to zero and
    apply rest to current. */ CASE WHEN [PastDueAmount] + ISNULL([ReceivedAmount], 0) 
                          < 0 THEN 0 ELSE [PastDueAmount] + ISNULL([ReceivedAmount],
    0) END WHEN ISNULL([ReceivedAmount], 0) = 0 AND 
                          [PastDueAmount] < 0 THEN 0 ELSE [PastDueAmount]
    END, 
                          [PaidAmount] = CASE WHEN [isis_loan].[SectionTypeCode]
    = 'LOAN_PRIN' THEN 0 ELSE CASE WHEN ISNULL([ReceivedAmount], 0) 
                          < 0 THEN /* We bring past due to zero and
    apply rest to current. */ CASE WHEN [PastDueAmount] + ISNULL([ReceivedAmount], 0) 
                          < 0 THEN - ([PastDueAmount] + ISNULL([ReceivedAmount],
    0)) ELSE 0 END WHEN ISNULL([ReceivedAmount], 0) = 0 AND 
                          [PastDueAmount] < 0 THEN - [PastDueAmount]
    ELSE 0 END END, 
                          [AmountDue] = CASE WHEN [isis_loan].[SectionTypeCode]
    = 'LOAN_PRIN' THEN [CurrentDueAmount] ELSE [unpaid].[AmountDue] END, [ID] = [il].[LoanID]
    FROM         [dbo].[INV_SubInvoice] isi JOIN
                          [dbo].[INV_Invoice] ii ON [isi].[InvoiceID]
    = [ii].[ID] JOIN
                          [dbo].[INV_Facility] [if] ON [isi].[ID] = [if].[SubInvoiceID]
    JOIN
                          [dbo].[INV_Loan] il ON [if].[ID] = [il].[INV_FacilityID]
    JOIN
                              (SELECT     [sis_loan].[ID],
    [sis_loan].[SectionTypeCode], [SectionType] = [st_loan].[Name], [sis_loan].[INV_LoanID]
                                FROM      
       [dbo].[INV_SubInvoiceSection] sis_loan JOIN
                   [dbo].[INV_SectionType] st_loan ON [sis_loan].[SectionTypeCode] = [st_loan].[Code]
                                WHERE      [INV_LoanID]
    IS NOT NULL AND [StatusCode] = 'BILL') isis_loan ON [il].[ID] = [isis_loan].[INV_LoanID] JOIN
                              (SELECT     [iffa].[SectionID],
    [AccrualDeterminationDateMax] = MAX([iffa].[AccrualDeterminationDate]), 
                   [AccrualDeterminationDateMin] = MIN([iffa].[AccrualDeterminationDate]), [CurrentDueAmount] = SUM([iffa].[ExpectedPrincipalAmount]), 
                   [ReceivedAmount] = SUM([ReceivedPrincipalAmount])
                                FROM      
       [dbo].[INV_LoanPrincipalAmortization] iffa
                                GROUP BY [iffa].[SectionID]
                                UNION
                                SELECT     [iffa].[SectionID],
    [AccrualDeterminationDateMax] = MAX([iffa].[AccrualDeterminationDate]), 
                  [AccrualDeterminationDateMin] = MIN([iffa].[AccrualDeterminationDate]), [CurrentDueAmount] = SUM([iffa].[AccruedInterestAmount]), 
                  [ReceivedAmount] = SUM([ReceivedInterestAmount])
                                FROM      
      [dbo].[INV_LoanCashInterestAccrual] iffa
                                GROUP BY [iffa].[SectionID]
                                UNION
                                SELECT     [iffa].[SectionID],
    [AccrualDeterminationDateMax] = MAX([iffa].[AccrualDeterminationDate]), 
                  [AccrualDeterminationDateMin] = MIN([iffa].[AccrualDeterminationDate]), [CurrentDueAmount] = SUM([iffa].[AccruedInterestAmount]), 
                  [ReceivedAmount] = SUM([ReceivedInterestAmount])
                                FROM      
      [dbo].[INV_LoanPIKInterestAccrual] iffa
                                GROUP BY [iffa].[SectionID])
    dates ON [isis_loan].[ID] = [dates].[SectionID] LEFT JOIN
                              (SELECT     [AmountDue]
    = [UnpaidPrincipalAmount], [SectionID], [AccrualDeterminationDate]
                                FROM      
       [dbo].[INV_LoanPrincipalAmortization]
                                UNION
                                SELECT     [AmountDue]
    = [UnpaidInterestAmount], [SectionID], [AccrualDeterminationDate]
                                FROM      
      [dbo].[INV_LoanCashInterestAccrual]
                                UNION
                                SELECT     [AmountDue]
    = [UnpaidInterestAmount], [SectionID], [AccrualDeterminationDate]
                                FROM      
      [dbo].[INV_LoanPIKInterestAccrual]) unpaid ON [dates].[SectionID] = [unpaid].[SectionID] AND 
                          [dates].[AccrualDeterminationDateMax] = [unpaid].[AccrualDeterminationDate]
    LEFT JOIN
                              (SELECT     [PastDueAmount]
    = SUM([PastDuePrincipalAmount]), [SectionID]
                                FROM      
       [dbo].[INV_LoanPrincipalAmortization]
                                GROUP BY [SectionID]
                                UNION
                                SELECT     [PastDueAmount]
    = SUM([PastDueInterestAmount]), [SectionID]
                                FROM      
      [dbo].[INV_LoanCashInterestAccrual]
                                GROUP BY [SectionID]
                                UNION
                                SELECT     [PastDueAmount]
    = SUM([PastDueInterestAmount]), [SectionID]
                                FROM      
      [dbo].[INV_LoanPIKInterestAccrual]
                                GROUP BY [SectionID]) pastdue
    ON [dates].[SectionID] = [pastdue].[SectionID]
    UNION
    SELECT     [isi].[InvoiceID], [ii].[DueDate], [SubInvoiceID] = [isi].[ID], [INV_FacilityID] = [if].[ID], [if].[FacilityID],
    [FacilityFeeID] = NULL, [il].[LoanID], [isi].[PortfolioID], [isi].[Portfolio], 
                          [PaymentType] = 'PIK Interest Applied', [Name]
    = [il].[Name], [ReceivedAmount], [CurrentDueAmount] = - [dates].[CurrentDueAmount], 
                          [PastDueAmount] = - CASE WHEN ISNULL([ReceivedAmount],
    0) > 0 THEN [PastDueAmount] + ISNULL([ReceivedAmount], 0) WHEN ISNULL([ReceivedAmount], 0) 
                          < 0 THEN /* We bring past due to zero and
    apply rest to current. */ CASE WHEN [PastDueAmount] + ISNULL([ReceivedAmount], 0) 
                          < 0 THEN 0 ELSE [PastDueAmount] + ISNULL([ReceivedAmount],
    0) END WHEN ISNULL([ReceivedAmount], 0) = 0 AND 
                          [PastDueAmount] < 0 THEN 0 ELSE [PastDueAmount]
    END, [PaidAmount] = - CASE WHEN ISNULL([ReceivedAmount], 0) 
                          < 0 THEN /* We bring past due to zero and
    apply rest to current. */ CASE WHEN [PastDueAmount] + ISNULL([ReceivedAmount], 0) 
                          < 0 THEN - ([PastDueAmount] + ISNULL([ReceivedAmount],
    0)) ELSE 0 END WHEN ISNULL([ReceivedAmount], 0) = 0 AND 
                          [PastDueAmount] < 0 THEN - [PastDueAmount]
    ELSE 0 END, [AmountDue] = - [AmountDue], [ID] = [il].[LoanID]
    FROM         [dbo].[INV_SubInvoice] isi JOIN
                          [dbo].[INV_Invoice] ii ON [isi].[InvoiceID]
    = [ii].[ID] JOIN
                          [dbo].[INV_Facility] [if] ON [isi].[ID] = [if].[SubInvoiceID]
    JOIN
                          [dbo].[INV_Loan] il ON [if].[ID] = [il].[INV_FacilityID]
    JOIN
                              (SELECT     [sis_loan].[ID],
    [sis_loan].[SectionTypeCode], [SectionType] = [st_loan].[Name], [sis_loan].[INV_LoanID]
                                FROM      
       [dbo].[INV_SubInvoiceSection] sis_loan JOIN
                   [dbo].[INV_SectionType] st_loan ON [sis_loan].[SectionTypeCode] = [st_loan].[Code]
                                WHERE      [INV_LoanID]
    IS NOT NULL AND [StatusCode] = 'BILL' AND [sis_loan].[SectionTypeCode] = 'LOAN_INT_PIK') isis_loan ON 
                          [il].[ID] = [isis_loan].[INV_LoanID] JOIN
                              (SELECT     [iffa].[SectionID],
    [AccrualDeterminationDateMax] = MAX([iffa].[AccrualDeterminationDate]), 
                   [AccrualDeterminationDateMin] = MIN([iffa].[AccrualDeterminationDate]), [CurrentDueAmount] = SUM([iffa].[AccruedInterestAmount]), 
                   [ReceivedAmount] = SUM([ReceivedInterestAmount])
                                FROM      
       [dbo].[INV_LoanPIKInterestAccrual] iffa
                                GROUP BY [iffa].[SectionID])
    dates ON [isis_loan].[ID] = [dates].[SectionID] LEFT JOIN
                              (SELECT     [AmountDue]
    = [UnpaidInterestAmount], [SectionID], [AccrualDeterminationDate]
                                FROM      
       [dbo].[INV_LoanPIKInterestAccrual]) unpaid ON [dates].[SectionID] = [unpaid].[SectionID] AND 
                          [dates].[AccrualDeterminationDateMax] = [unpaid].[AccrualDeterminationDate]
    LEFT JOIN
                              (SELECT     [PastDueAmount]
    = SUM([PastDueInterestAmount]), [SectionID]
                                FROM      
       [dbo].[INV_LoanPIKInterestAccrual]
                                GROUP BY [SectionID]) pastdue
    ON [dates].[SectionID] = [pastdue].[SectionID]

Maybe you are looking for

  • Is it possible to use External HD as main boot drive? (Help!)

    Hi all I am about to buy a Seagate FreeAgent Pro (link: http://www.bhphotovideo.com/c/product/478636-REG/SeagateST305004FPA1E3_RK_FreeAgent_Pro_500GB_eSATA.html) with 500Gb and FW400/USB2.0/eSATA. I have a Mac Mini, and its internal HD is too small f

  • Who do i contact to get my iphone 4 blacklisted so the person who stole it will not be able to use it

    who do i contact to get my iphone blacklisted so the person who stole it will not be able to use it

  • Formula in POV row converted to text on refresh

    We are upgrading our Essbase and Smart View set up to the latest versions (11.1.2.2 and 11.1.2.5 respectively). Currently our reports use the old grid format, so I am converting them to the new format, including having the POV on the sheet itself. On

  • Japanese character

    Hi All, Is there is any way to display the japanese character in the application.We have made a smart sync application which is working fine for English language but when we use the application for Japanese user for japanese data..the data is coming

  • How does this program work???

    My Mac Powerbook G4 has GarageBand 3.0.4, which I have not yet used. Now I want to create a file which has one track entered from an aifc file (converted from Sibelius 4 with Wire Tap Pro). Once I have this as a GB file, I want to overlay a second vo