Regarding Running Totals
Hi All,
I have a requirement where I need to calculate the running balance for each customer as below table.
CUSTOMER_NAME TRN_AMT RUNNING BALANCE
CUST_A 500 500
CUST_A 100 600
CUST_B 300 300
CUST_B 150 450
I am able to get the running balance for the entire report. But I am not able to achieve the running balance for each customer.
Please help me in this regard.
BIPuser wrote:
Take a look at the Running Total.rtf template under your BI publisher Desktop installation (example: C:\Program Files\Oracle\BI Publisher\BI Publisher Desktop\Template Builder for Word\samples\RTF templates\Advanced)
Thanks,
BipuserHi,
I couldn't find those RTFs in the mentioned location. Also I searched in the entire folder, but couldn't find it out. Please provide me any link which I can access to get the templates.
Similar Messages
-
Running Total & Distinct Count Query
Crystal 10.0.0.533 CR Professional
Hope you can assist.
I have a report listing deals signed, each deal has a corresponding category i.e. industry type, Accountant, Chiropractor, Financial Services, etc.
I am undertaking a Distinct Count on these categories so that in the group footer it is showing number of different categories signed in a period (the report is grouped into different date periods). This is working OK.
However, I need to EXCLUDE the category from this distinct count if the deal value is zero.
I have tried using a formula to show a blank field if the value is zero, however it appears to be distinctly counting the blank as a category?
Any assistance would be much appreciated.
TracyDeffinetly it will be less than what you expect for grand total. It is because when you are calculating distinct count for each group suppose
Group A has categories A,B,C,D-->distinct count (4)
Group B has C,D,E,F-->distinct count (4)
but while calculating grand total then the distinct count will be
A,B,C,D,E,F --> grand total (6) but not (8).
In this case you need to use mannual running total like this
whileprintingrecords;
numbervar i;
i:=i+{running total};
place this in group footer and create another fomula like this
whileprintingrecords;
numbervar i;
place this in report footer to get the correct grand total.
Regards,
Raghavendra -
Is it possible to create an invoive that keeps a running total in one column and in another column keep total of monies spent from a starting amount of funding?
Hi Sara,
Many thanks for your reply. We just brought Adobe Acrobat XI Pro complete
with Adobe Forms Central, My manager asked whether I could use the forms
part to create a summary tracking sheet for all of our contracts.
Having looked at it I could see how to create a table that in the first
column deleted costs from a starting fund, and in the last keeps a running
total of all monies spent.
I agree, Excel does seem to be much better suited to the task. I was try
trying to comply with her request
Regards, -
Running totals in crystal designer
Hi all!
I want to create a report with running total, that accumulate Balance value for each page.
Total accumulate should be reseted on each new page.
I have a query for report: SELECT CardCode, CardName, Balance FROM OCRD.
And i want a running total for field "Balance" (this total should be reseted on each new page).
In Crystal Designer I create new Running Total Field (in the PageFooter section).
In the Editing Running Total window I fill the following sections:
1) Summary section. Field to summarize: "Command.balance". Type of summary: "sum".
2) Evaluate section. On change of field: "command.cardcode"
3) Reset section. I want to choose PageNumber in the field "on change of field". But there is no any special field in the section "Available tables and fields"
How to reset the running total on each new page?
Thanks in advanceHi all!
The problem can be solved with report formulas. Probably this information will be useful to somebody.
So, we have the following task: need to calculate subtotals on each page.
Let's look at the solution.
On the first step, create Formula fields:
1) InitPageSum field has formula:
WhilePrintingRecords; NumberVar PageSum := 0;
2) CalcPageSum field has formula:
WhilePrintingRecords;
numberVar PageSum := PageSum + {Command.LineTotal}; // I use command to get field-values from //database
numberVar PageSum
3) PageBalance field has the following formula:
WhilePrintingRecords; numberVar PageSum
On the second step we place formula-fields in report sections.
1) Variables initialization.
Insert section in PageHeader area (lets name this section PHa). Drag formula InitPageSum into PHa for zeroing PageSum for each page. Then suppress the section PHa.
2) Increasing subtotal on page.
Create additional section in Details area (Dc). Drag CalcPageSum formula-field on this section (Dc). PageSum variable will be increasing in each line. Suppress the section Dc.
3) Display results.
a) Insert additional section in PageFooter area (let's name it PFa). Drag PageBalance formula-field into this section (PFa). The section PFa should be displayed on each page of the report, except the last page. The formula is:
if PageNumber <> TotalPageCount then true else false.
b) Insert additional section in ReportFooter area (let's name it RFa) and make this section the first section of the Report Footer area. Drag PageBalance formula-field into the section RFa. The section RFa should be displayed on the last page only. So, for the Suppress property of this section, create the formula:
if PageNumber = TotalPageCount then true else false
We make this adjustment (additional section in report footer area) because we need subtotals directly under the report (and not at the bottom of the page)
Best regards,
Katrine -
Cumulative Balance Running Total
Hello community,
i am doing a business partner Account balance report, i have already successfully fetch my data in to crystal reports as well as the running total for the cumulative balance, my problem is i have a duplicated rows in debit side, now how will i say to crystal reports (in Formula expression) that the 1st line if duplicated will the only one to be evaluated. for more detail please see image below
http://i264.photobucket.com/albums/ii184/abing430/CRDuplicatedRows.png
http://i264.photobucket.com/albums/ii184/abing430/CRDuplicatedRows-1.png
please help.
best regards,
Fidelhello sharonamt,
thanks for the response.
//Head
Shared NumberVar OB := {Command.Open Balance}
//Line
shared numbervar OB;
OB := OB + {BP_AccountBalance;1.Credit} - {BP_AccountBalance;1.Debit}
//Footer
Shared numbervar OB
i have this ff. formula the header is put in the page header, the line is put ing Group Footer section and the footer is put in report footer section. my group is grouped by Ref field w/c is unique in this report.
the duplicated rows is eliminated since i put my line formula in the group footer. but using the ff. formula's the report is ok, the results is fine on the first page only, because in the second page it will get the OB balance which is in the page header of the report., i dont needt to reset my running total.
thanks.
please help
best regards.
EDIT:
i have manage to figure out my problem... i just use this formula and it works.
whileprintingrecords;
if pagenumber = 1 then Shared NumberVar OB := {OpeningBalance.Open Balance}
else
0
since im having problem with reseting of the openingbalance, i had trap the page numvber and never reset the running total. this formula works for me as of now.
Fidel
Edited by: Avelino Fidel on Jan 24, 2011 2:46 PM -
Hi,
Is there a way in QLD can have a running total like the Crystal Report capabilities? Is this possible in the Repetative Area1.
Example :
DocTotal Drawsum Result
500000 200000 300000
300000 100000 200000
200000 200000 0
The purpose of this is for Cash Advance Monitoring from AP Downpayment Invoice.
Is this possible by running difference / Balance ?
Thank you very much.
Regards,
clintHi Suda,
this is the data for you to refer :
CREATE TABLE (
INT,
DATETIME,
NVARCHAR(100),
NUMERIC(15,2),
NUMERIC(15,2),
INT,
NUMERIC(15,2),
NUMERIC(15,2),
NUMERIC(15,2),
NUMERIC(15,2)
GO
/* Data for the `Query_Result` table (Records 1 - 8) */
INSERT INTO (, , , , , , , , , )
VALUES (1575, '20080110', N'SAADA PASIGAN', N'0', N'165308.83', 135, N'165308.83', N'500000', N'334691.17', N'334691.17')
GO
INSERT INTO (, , , , , , , , , )
VALUES (1592, '20080111', N'SAADA PASIGAN', N'0', N'79563.6', 135, N'79563.6', N'500000', N'420436.4', N'420436.4')
GO
INSERT INTO (, , , , , , , , , )
VALUES (1599, '20080111', N'SAADA PASIGAN', N'0', N'53102.95', 135, N'53102.95', N'500000', N'446897.05', N'446897.05')
GO
INSERT INTO (, , , , , , , , , )
VALUES (1604, '20080111', N'SAADA PASIGAN', N'0', N'38415.6', 135, N'38415.6', N'500000', N'461584.4', N'461584.4')
GO
It compute for the difference of the DocTotal1 and Drawsum, that is correct but I want to have a running diffrence betwenn MIN(Drawsum) only.
Example from the above data :
The total Cash Advance is 500000 only. The Drawsum will deduct the 500000 until it become zero. Refer Below :
Doctotal DrawSum The Remaining Total of 500000
500000 165308.83 334691.17
the remaining amt shall be carry on which is the 334691.17 and not the 500000.
DocTotal DrawSum The Remaining Total of 500000
334691.17 79563.6 255127.57
255127.57 53102.95 202024.62
202024.62 38415.6 163609.2
and so onn...
Hope that you got me.
Thank you.
Clint -
Manual Running Total vs Running Total
Morning all,
It is some what strange to me when I try to use a formula to calculate the total jobs and when I try to use Running total to count the same total jobs. Both answers in theory should be the same however they are not. I am wondering where am I going wrong in the manual formula.
If {despatch_summary.job_type}="FSV" then
if {despatch_summary.order_status}<>0 then
{despatch_summary.order_no}
else
0
The above code then gets DistinctCount ({@FSV})
The same method if I use by using Running Total it gives the correct number of jobs.
Running Total
field to summarize : despatch_summary.order_no
Summary Type: DistinctCount
Formula: {despatch_summary.job_type}="FSV" and {despatch_summary.order_status}<>0
Reset: none
The formula gives me 513 where as the same running total gives me 514
Where am I going wrong?
Strangely it is adding 1 to all of my manual running totals (1 is coming from canceled orders).
Many thanks
RegardsSastry I am adding this formula into the crosstab which is setup by Number of days. So on the column it is number of days and on the summarized field it is this formula.
I chose Group options and clicked on DistinctCount after adding the formula into the summarized field.
I have already tried the formula you have suggested however it doesn't seem to be affecting it.
Apart from that what I have just done is added the Running Totals to the Summarized field which is coming up correctly however now the problem is to get their percentages.
I have used the following code but it doesn't seem to be working.
Whileprintingrecords;
Numbervar g:=Currentfieldvalue;
Numbervar h:={@TotalJobs-CanceledJobs};
Numbervar i:=0;
i:=((g/h)*100);
Numbervar gTot:=gTot+i;
if gTot > 100 then "100.00%"
else
totext(gTot,2)+"%"
I know I am doing it wrong when it comes to percentages. I need to get the percentages off that Running Total (Grand Total).
Am not sure how to acheive that either.
Many thanks
Regards
Jehanzeb -
Hello All,
I have written manual running total formula:
Reset formula in group header:
whileprintingrecords;
numbervar sol:=0;
Evaluation formula in detail section
whileprintingrecords;
numbervar sol;
if Field_Name1 <> previous(Field_Name1) then
sol:= sol+ Amount;
Display formula in group footer;
whileprintingrecords;
numbervar sol;
But the total doesn't seem to match, can someone help me!
Thanks!
SonaliHi Sonali,
For Ex:
1) If the group is on County> U, and country has 40 detailed records.
2) The Option " Repeat group header on each page is checked" and a reset formula is placed in the
group header.
3) In one page take for example 25 detail records are printed the evaluation formula will evaluate for 25
records. And in teh next page again the group header will be printed. This causes the reset formula
to print again where the total becomes zero again. And the remaining 15 records will be added and
the group footer will display that total.
Regards,
Vinay -
Post Author: bahamaER
CA Forum: Crystal Reports
Hello, I have been reviewing threads for running totals and would like some assistance on creating a running total for a group with a condition that will display in the group header, the running total should also reset for each group. Is this possible?
I know that there are some constraints such as the variable being reset to 0 in the header for each group as well as the group records have not been rendered when the header formulas are being assessed. I have been able to accomplish the task of running totals with conditions for groups using a running total field and also 3 separate formulas placed in the group header, detail and footer. The display is only correct in the group footer; my goal is to have the footer formula in the group header. Any ideas? I am currently using CR 8.5 but will be upgrading to CR 2008.
ThankyouHi,
If you are trying to calculate Total and display it in Group Header for field value placed in Detail, then you will get incorrect/no value for total, as Crystal Reports prints/processes the report line by line and it will not be able to process the Total for field in Detail section in Group Header.
Its is by Design.
For a workaround:
- Insert the same probematic report (Say A.rpt) as a Subreport in Group Header of this report(Say A.rpt).(Say in GroupHeader A1) and link the Main Report to the
- Insert Section Below (Say GroupHeader A2)
- Calculate Total in Section Group Header A2)
This workaround will reduce the Performance of the report as Subreport will be proceed for each Group Value.
Regards,
Kiran -
Dear all,
I am creating a new report which needs a conditional running total.
I need to sum the credits quantity if the following condtions are met
line_type="S" and
line_no<3
I used running total like this
Field to summarize: lab_credits2.credit_qty
Type of Summary: SUM
Evaluate: Use formula
{lab_credits2.line_type}="S" and
{lab_credits2.line_no}<3;
Reset: On change of group (Reason Code).
When I ran the report, it did not produce the right results, so I placed the line type and line no into the same Group footer and ran the report.
I found out that the report is not filtering the linetype and line no.
Result shows
Line Type ="S" - 100 - Line number =1
Line Type = "M" - 200 - Line number=6
and so on.
The report is grouped by Reason Code.
Any ideas why would it not be filtering the records?
Report Record Selection Code
{lab_credits.credit_date}>={?startdate} and
{lab_credits.credit_date}<={?enddate} and
{lab_credits.credit_status} = 2;
Status=2 is needed there to filter the Order numbers correctly.
Many thanks
Regards
JehanzebThanks James,
I have put all three in detail and used the filteration and it worked under detail section however the results when used in total SUM is produced incorrectly.
I suspect it might be of database table linkage? or maybe I have done something wrong in the report.
I am going to create another report and see if that works.
Will post info here.
Regards
Jehanzeb
Edited by: Jehanzeb Navid on Sep 4, 2008 11:55 AM
Right I found the issue however I don't know how to resolve it.
I have 4 tables in the database
1: Lab Credits - Order_num, Credit_status, Reason_code
2: Lab Credits2 - Order_num, Line_no, Line_type, Credit_qty
3: Lab Reasons - Reason_code,Reason_description
4: Oetrn2 - Order_num
This is how they are linked up
Lab_Credits_Order_num = Lab_credits2_order_num and oetrn2_order_num
Lab_Credits_Reason_code = lab_reasons_reason_Code
Report Grouping
Grouped by Reason Code
Date range - month to date
Report Record Selection
{lab_credits.credit_date} in monthtodate and
{lab_credits2.line_no}<3 and
{lab_credits2.line_type}="S" and
{lab_credits.credit_status}=2;
Now the issue
When I add sum of qty of lab_credits2_credit_qty into the report Group footer,it produces the right results However when I add
DistinctCount of Oetrn2_Order_num into the Group footer, it creates totally different Sum of Lab Credit Qty results. (Please note: The oetrn2_order_num results appear fine, however they messup Sum of Lab_credit_credit_qty).
What do you think where am I doing wrong?
It has to be something to do with table linkage.
Regards
Jehanzeb -
Running total for duplicate rows
Hi,
I am trying to write an sql which shows the running total for records which has duplicate. Please share any idea to get this.
sample rows:
col1 col2 col3
1 A 2
1 A 2
1 A 2
1 B 3
1 B 3
1 C 5
1 D 2
1 D 2o/p required:
col1 col2 col3 cumulative_tot
1 A 2 2
1 A 2 2
1 A 2 2
1 B 3 5
1 B 3 5
1 C 5 10
1 D 2 12
1 D 2 12Hi,
Try this:
WITH A AS
select 1 col1, 'A' col2, 2 col3 from dual union all
select 1 col1, 'A' col2, 2 col3 from dual union all
select 1 col1, 'A' col2, 2 col3 from dual union all
select 1 col1, 'B' col2, 3 col3 from dual union all
select 1 col1, 'B' col2, 3 col3 from dual union all
select 1 col1, 'C' col2, 5 col3 from dual union all
select 1 col1, 'D' col2, 2 col3 from dual union all
select 1 col1, 'D' col2, 2 col3 from dual
,B AS
SELECT
A.*
,ROW_NUMBER() OVER (PARTITION BY COL1, COL2 ORDER BY 1) RN
FROM
A
SELECT
B.*
,SUM(CASE WHEN RN = 1 THEN COL3 ELSE 0 END) OVER ( ORDER BY COL1, COL2 ,RN ) cumulative_tot
FROM
B
COL1 COL2 COL3 RN CUMULATIVE_TOT
1 A 2 1 2
1 A 2 2 2
1 A 2 3 2
1 B 3 1 5
1 B 3 2 5
1 C 5 1 10
1 D 2 1 12
1 D 2 2 12
8 rows selected Regards,
Peter -
Running total / Summary - 3 groups
Dear All,
I am facing an problem in Summary / Running Total in my crystal Report. I have 3 groups as under :
1) Document Series
2) Territory
3) Transaction Details which includes Document Total
Now Example my document series is Projects and Territory is Japan and India and in Transaction Details which is document total has values of 100, 200, 300,500 for Japan and 300,400 for India
Now I am not able to bring a summary / running total of Japan which should be 1100 and for India 700 respectively.
I want summary for Document Series Also means for Projects it should show the total of 1100 + 700 = 1800
and a grand total of 1800 if its only projects series and if other series it should show projects + handling series.
Pleas help as I have tried but not been successful.
regards,
kamleshfor Territory Running total
1. Field to summarize : documentTotal
2. Evaluate : for each record
3. Reset: on change of field -> Territory
Place it in Territory Group footer
for Document Series Total
1. Field to summarize : documentTotal
2. Evaluate : for each record
3. Reset: documentseries
Place it in Document Series group Footer
for Grand Total
1. Field to summarize : documentTotal
2. Evaluate : for each record
3. Reset: never
Place it in Report Footer
HTH,
Jyothi -
Running Total Grouping Formula
I have a running total condition that I need to summarize the field CAWP.BAC. I would typicaly evaluate this total for change of group 4 and reset on change of group 3. I need to condition the evaluation for ".900" in {CAWP.WP} but i also need to evaluate for change of group 4. Does any one have any examples of a formula for evaluation "on change of group"?
Hi John,
For this you can try using manual running total formula's.
1) Create a @reset formula as below and place it in group header 3.
Formula :
Whileprintingrecords;
Numbervar i:=0;
2) Create an @evaluation formula and place it in detail section.
Formula:
whileprintingrecords;
numbervar i;
if {CAWP.WP} = ".900" then
i:= i+ {CAWP.BAC}
3) Create a @display formula and place it in group footer 4.
Formula:
whileprintingrecords;
numbervar i;
Hope this will help!!
Regards,
Vinay -
Running Total for "cleared balance"
I want to produce query that will produce two running totals. The 1st once is straight forward and is 'Ledger Balance' - that is the balance after a particular transaction has taken place on that day. The Cleared Balance is the running total balance accounting for the value date of a transaction. For example a transaction for today, say $50 may be value dated tomorrow and hence is included in the Ledger Balance but would not appear in the Cleared balance until tomorrow.
Lets try and use some simple data:
TransactionsTable
Tran_ID TranDate ValueDate Amount
1 01/02/2004 01/02/2004 50
2 01/02/2004 01/02/2004 25
3 01/02/2004 05/02/2004 30
4 01/02/2004 01/02/2004 55
5 02/02/2004 04/02/2004 11
6 02/02/2004 02/02/2004 23
7 02/02/2004 02/02/2004 33
8 02/02/2004 02/02/2004 47
9 04/02/2004 04/02/2004 10
10 07/02/2004 07/02/2004 5
StatementHistory
AC_No Start_Date End_Date Opening_Ledger Opening_Cleared
55 02/02/2004 02/02/2004 160 130
55 04/03/2004 04/02/2004 274 233
Assuming that the account opened on the 01/02/04 with a zero balance.
So for a daily statement on the 01/02/04, I'd expect to see the following Details
TranDate ValueDate Amount Ledger Balance Cleared Balance
01/02/2004 01/02/2004 50 50 50
01/02/2004 01/02/2004 25 75 75
01/02/2004 05/02/2004 30 105 75
01/02/2004 01/02/2004 55 160 130
So for a daily statement on the 02/02/04, I'd expect to see the following Details
TranDate ValueDate Amount Ledger Balance Cleared Balance
02/02/2004 04/02/2004 11 171 130
02/02/2004 02/02/2004 23 194 153
02/02/2004 02/02/2004 33 227 186
02/02/2004 02/02/2004 47 274 233
And skipping to the 04/02/04, I'd expect to see.
04/02/2004 04/02/2004 10 284 254
I can get the ledger balance using:
sum(amount_to_account) OVER (PARTITION BY ac_no , trans_ID
ORDER BY TranDate, trans_ID
RANGE UNBOUNDED PRECEDING)
+ sh.Opening_Ledger
But I'm unsure how to get the Cleared balance as this need to access transaction inforation from a number of days previous (possibly up to 5 days allowing for maximum period for clearing a transaction).
Does anyone have an idea how to achive this?Hi,
Try this:
WITH A AS
select 1 col1, 'A' col2, 2 col3 from dual union all
select 1 col1, 'A' col2, 2 col3 from dual union all
select 1 col1, 'A' col2, 2 col3 from dual union all
select 1 col1, 'B' col2, 3 col3 from dual union all
select 1 col1, 'B' col2, 3 col3 from dual union all
select 1 col1, 'C' col2, 5 col3 from dual union all
select 1 col1, 'D' col2, 2 col3 from dual union all
select 1 col1, 'D' col2, 2 col3 from dual
,B AS
SELECT
A.*
,ROW_NUMBER() OVER (PARTITION BY COL1, COL2 ORDER BY 1) RN
FROM
A
SELECT
B.*
,SUM(CASE WHEN RN = 1 THEN COL3 ELSE 0 END) OVER ( ORDER BY COL1, COL2 ,RN ) cumulative_tot
FROM
B
COL1 COL2 COL3 RN CUMULATIVE_TOT
1 A 2 1 2
1 A 2 2 2
1 A 2 3 2
1 B 3 1 5
1 B 3 2 5
1 C 5 1 10
1 D 2 1 12
1 D 2 2 12
8 rows selected Regards,
Peter -
Can i sum and couunt running total in formula?.
Please let me know.Hey, we can do count and sum functions in Running total.
These functions are available in crystal reports for summary fields.
We can create the running total based on the type of summary like Sum, count, max, min, distinct count, etc.
We can do Evaluation for each record or on group or on each field and also be done by writing a formula.
We can do count or sum by manual running total by writing a formula in the formula workshop.
Based on our requirement we can use both functionalities.
Please let me know if you have any queries.
Regards,
Naveen.
Maybe you are looking for
-
New nano not recognized by laptop (already followed all suggestions on site
I have a 3rd generation iPod and it connects to my desktop and is recognized just fine (so that implies no hardware issues). I however do not want to use it with my desktop, I want to use it with my laptop. I have re-installed the USB drivers to no a
-
Copy Custom toolbar from one instance to another in Project server 2007
Hi, I am currently using project server 2007. We have a number of instances in our Project server enivoronment. Is it possible to copy customized toolbar from one instance to another? If yes, how? Thanks in advance
-
Restricting transaction VL06O by distribution channel
Hello, Can someone please help as I am new to this? I have added transaction VL06O to a role and I need to restrict this by distribution channel. When I have checked in SU24, there is no authorisation object associated with the transaction that will
-
Parent account on historical pipeline analysis
Hi, I've a little problem with Oracle CRM on Demand Answers: When I use the subject area "historical pipeline" analysis I do not have acces to the parent account. There is an account area in which I have tons of fields but not the parent account. So
-
While trying to install Windows, I had some strange problems related to the partitioning. (a link to my last post detailing my problems is below) Today I backed up my harddrive and reinstalled OS X. Nothing changed in the Windows installer. And so I