Running Total Changes?
Post Author: cjsmile2106
CA Forum: Formula
Hello Everyone
I have a weird problem. I have a report that has three groups. In each group I have manual running totals. I would like to take a manual running total that I have in Group 2 and subtract it from my Group 3 manual running total. However when I attempt this for some odd reason by manual running total from Group 2 is not subracting that same number. For example:
Group3
5 - 7 = -210 - 7 = 315 - 7 = 820 -7 13
Group 2
-7
Its not doing that however, it seems to be subracting some random numbers instead of the Group 2 total. Thank you for your assistance!
Post Author: sharonmtowler
CA Forum: Formula
make sure you do not have repeat group header or keep group together checked, causing weird mrt. make sure the variable name is not used in another variable name. you may need to place the formula that is subtracting the display formulas below the other to get an accurate set, and use whileprintingrecords
Similar Messages
-
Running Total does not reset when group changes
I have a manual running total for group3 that does not reset for group2
Group2 Header (Order Status 3=Open,4=Closed)
WhilePrintingRecords;
currencyVar WIP=0;
Group3 footer (Order Number)
WhilePrintingRecords;
currencyVar WIP;
WIP := WIP + {@NETWIP}
Group2 footer
WhilePrintingRecords;
currencyVar WIP;
There are no Repeat Group header on any of the groups
Will add Group1 total when this part works.I am not sure if you made a typo when making your post but you are missing a colon when resetting your variable
change from this
currencyVar WIP=0;
to this
currencyVar WIP:=0; -
Item Transaction History Report - Calculation for creating 'Running Total'
Hello
Using Oracle Discoverer, we have written a report that pulls back all Inventory Transactions (by item number). This report lists both transactions IN (e.g. receipts into the store) and OUT (e.g. issues out from the store).
Our customer would like an additional column, to represent 'Running Total', to be added to the report. This column needs to capture the running 'On Hand Quantity' for the associated Item, as each transaction (both transactions IN and OUT of store) is displayed.
For example, if the initial/first transaction for an item was a Receipt of 500, then this column (on the first line) should display 500. If the second transaction for the item was an issue of 15, then this column (on the second line) should display 485. If the third transaction was for an issue of 50, then this column (on the third line) should display 435. If the fourth transaction was for a receipt of 20, then this column (on the fourth line) should display 455 etc etc
I'm not sure how I'd write a calculation to cater for this (within discoverer) - do you know if this is achievable? Any help would be much appreciated. This would be easy enough to do in Excel, but I'm a bit of a novice when it comes to discoverer(!)
Many thanks
RossHi,
You can generally do this type of calculation using analytic functions. You would partition by the item number and order by the transaction date in the analytic function. You can use SUM function (with an order by) to get a running total of a column in the report. You can SUM a calculation containing a CASE statement which changes the OUT transactions to a negative number. The SUM function will start at zero, so you then can use FIRST_VALUE function to get the first value for the item which you could then add to the totals.
Rod West -
Running totals: Custom Reset via Formula? (VS 2005)
Post Author: PunchngMrGrumpy
CA Forum: .NET
Hi All,I have attached a screenshot to help make up for my inability to describe the situation I'm dealing with here.I
have three groups within a report that currently use distinct Running
Totals fields that Reset at the group levels that I assigned. I am
attempting to create a single Running Totals field for all 3 groups
that will reset depending on which Group is being calculated at the
moment so that I don't have to have 3 separate Running Totals object
for each and every group. I'm not sure how to do this or write this
formula as I'm new to Crystal Reports and am used to SQL Reporting
Services where this evaluation is automatically done for you (I was
spoiled I guess).For example, if the Running Totals field
control is in Group #1, I want it to reset at Group #1, and Group#2 to
reset at Group #2, etc without having to create a field for each group.So
basically I'm attempting to use a formula to create a Reset point (view
screenshot for detail) that is determined by which group the data is
being calculated in. Is this possible? I realize that it is possible by
simply creating a new running total object for each group and telling
it to reset on change of group specified, but this seems completely
redundant and overly time consuming for larger reports where there are
multiple groups and a lot of Running totals fields.I'm developing the report with Crystal Reports within Visual Studio 2005 if that helps any.I
don't know if you'll be able to see it, but I have a screenshot link to
explain what I'm trying to do. http://www.codeguru.com/forum/attachment.php?attachmentid=19302Thanks!Hi Abhilash,
Thanks for the code, but the totals aren't right still yet.
Also, I just noticed my running total is not functioning properly. Count be the reason for my delima.
Any suggestions on how to get the running total to function properly?
What I just noticed is:
Date Patient Count
7/9/13 Patient A 7
8/8/13 Patient B 8
8/8/13 Patient B 8
8/8/13 Patient C 8
8/8/13 Patient D 8
8/15/13 Patient E 9
Would I be better off to do a formula vs a running total? -
Running Total Issue or Possibly Formula Issue in Crystal Reports 9
Post Author: Jeffs23
CA Forum: Formula
My issue involves two formula's - @TotalTime and @Converted Time and a Running Total (RTotal0).
@TotalTime{Data.ApptTime}/60@Converted Timenumbervar x := {#RTotal0};totext(truncate(x),0,"")" Hrs "totext(remainder(x,truncate(x))*60,0,"") + " Mins"Running Total (RTotal0)
Field to Summarize - @TotalTime
Type of Summary - sum
Under Evaluate Section:
"Use a Formula":
onfirstrecord or
{Data.ResourceStart} <> previous({Data.ResourceStart}) or
{Data.Resource} <> previous({Data.Resource})
) and
minimum({Data.ApptKind},{Data.ResourceStart}) = 1 AND
maximum({Data.Column},{Data.ResourceStart}) >= '1'
Reset on change of field {Data.Resource}
A little background:My report deals with a Doctors schedule. In the doctors schedule, a appointment is booked and is by default placed into Column 1. It always defaults to Column 1. If the provider elects to double book their time and schedule another patient at the exact same time, the second appointment hits column 2. It expands in essence. It is possible to have up to 4 appointments in one time slot. This is why we wait forever at the Doctors office - appointments get overbooked because patients cancel or no show frequently and the provider would rather have the patients wait then risk no appointment at all. My Client wants the "TOTAL TIME" a provider was "scheduled" to see patients, not the time they actually saw the patients. So if the Provider was scheduled to see patients from 8 am to noon and had patients doublebooked for every time slot, I only want to report the overall time he saw patients regardless of the doublebooking, triplebooking or quadruplebooking. So the total time for my example should be 4 hours not 8 hours. The good news is this is painfully close to being correct! What is currently happening, is if the schedule contains more than 1 facility the time calculates wrong. I think my issue may be in the running Total but not 100% sure. I need it to calculate time on each facility - {Data.Facility}.Post Author: Jeffs23
CA Forum: Formula
I had some minor issues with my formulas and Running Total so I modified them alittle:
@TotalTime
If {Data.ApptTime} = 0 then 0else {Data.ApptTime}
@Converted Time
If {#RTotal0} = 0 then "--"else ToText(Truncate({#RTotal0}/60),0,"") + " Hour(s), " + ToText(Remainder({#RTotal0},60),0,"") + " Min(s)"
My running total stayed the same.......
Field to Summarize - @TotalTime Type of Summary - sum Under Evaluate Section: "Use a Formula":(onfirstrecord or{Data.ResourceStart} <> previous({Data.ResourceStart}) or{Data.Resource} <> previous({Data.Resource}) ) andminimum({Data.ApptKind},{Data.ResourceStart}) = 1 AND maximum({Data.Column},{Data.ResourceStart}) >= '1' Reset on change of field {Data.Resource}
Some fake sample data:
Resource = Francis, William MD
Facility 1: River Oaks Main Clinic
Facility 2: Western Medical Hospital
Date of Service = 10/25/2007
From 7:15 am to 11:45 am, Patients were treated at Facility 1: River Oaks Main Clinic *** (total time = 4 hours 30 min)
From 12:15 pm to 1:00 pm, Patients were treated at Facility 2: Western Medical Hospital *** (total time = 45 min)
From 1:00 pm to 3:15 pm, Patients were treated at Facility 1: River Oaks Main Clinic *** (total time = 2 Hours 15 min)
The report should tell me Total time at River Oaks Main Clinic = 6 Hours 45 min and 45 min for Western Medical Hospital. What it currently is doing, is reporting the 6 Hours 45 min on the River Oaks Main Clinic and 7 Hours 30 min on the Western Medical Hospital. The time for this facility should be 45 minutes, yet its taking the full provider time and throwing it into this second facility. I am assuming its because the Running total tells it "Reset on change of field {Data.Resource}". Somehow, I need it to evaluate on both the Resource and the Facility. Any suggestions? -
Running Total in forms 4.5
Hi,
I have a forms 4.5 with a master and detail block.
The detail block displays 15 record at a time. There is a column in the detail field whose total is to be displayed at the bottom.
I am using post-query to sum this item and display it at the bottom.
The solution works fine fine if the detail block has 15 or less records and the running total is displayed correctly.
But If I query a master records where there are 20 detail records then the total sum at the bottom only show sum of the 15 detail records that are displayed and not 20.
For that I have to navigate to record 15, key next , 16 and so on then the post-query trigger fires and add the rest of the records and displays the correct total.
I have tried to change the record buffered/fetched in the detail block query but it does not help.
Can anyone suggest a solution for this problem in forms 4.5?
Thanks
JakhTry Last_record instead of next_record.
Any other suggestion is that.
You must have a primary key and foreign key in your master detail form. Then why dont you write a select statement on POST-QUERY:
You have a master block (master) having columns invoice_id, date, cust_id and have a detailed block (detail) having columns invoice_id (using as foreign key from master table block) and item_id, item_description, quantity, amount
Write query on POST-QUERY on detail block as
select sum(amount) into :control_block.total from detail where detail.invoice_id = :master.invoice_id
or select sum(amount) into :control_block.total from detail where detail.invoice_id = :detail1.invoice_id;
it should give you the required result. I have used it and its working fine for me.
Thanks.
Hassan -
Crystal report running total balance
Hi guys, please help me.
im creating a report using crystal report that display running balance from subreport.
i do have subreport and add it to main report but i need it real time changing.
for example
TRANSACTION TYPE QTY_IN QTY_OUT RUNNING BALANCE
RECEIVED 1 0 1
RECEIVED 2 0 3
SHIP OUT 0 1 2
SHIP OUT 0 1 1
RECEIVED 1 0 2
diagram shows the needed output of the report. please help. thankshi sir abhilash, i know you know how to fix this, maybe i need to provide some more information about the report: here what i did:
created formula @QTY_IN where code is:
if {ITRN.TRANTYPE} = 'DP' then
{ITRN.QTY}
else
if{ITRN.TRANTYPE}='AJ' then
(if {ITRN.QTY} >=0 then {ITRN.QTY}) else
0
create formula @QTY_OUT
if{ITRN.TRANTYPE}='AJ' then
(if {ITRN.QTY} >=0 then 0 else
{ITRN.QTY}) else
if{ITRN.TRANTYPE}='WD' then
{ITRN.QTY}
else 0
create running total fields for @QTY_IN And @QTY_OUT
total_qty_in and total_qty_out
sum the fields and resets every change of group.
create a formula(running) based on your suggetion
create running_total_reset code is
WhilePrintingRecords;
numbervar rt := 0;
paste it to group header.
the output is
in out running
shipment 0 -4 146116
shipment 0 -1 146117
shipment 0 -4 146116
but it should be
in out running
shipment 0 -4 (-146118) 146114
shipment 0 -1 (-146114) 146113
shipment 0 -4 (-146113) 146109
so on so forth.
we can do this sir. thanks ^__^.
really appreciate your help. -
Running total and Next function in Crosstab
<strong><font size="3"><font face="Times New Roman">Clarifications on getting Next Running sum and count on a Crosstab</font></font></strong><font face="Times New Roman" size="3"> </font> <p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="Times New Roman" size="3">Here is the example, which I am working on:</font></p><p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="Times New Roman" size="3">Highlights of the Report:</font></p><p style="margin: 0in 0in 0pt 0.5in; text-indent: -0.25in; tab-stops: list .5in" class="MsoNormal"><font face="Times New Roman"><span><font size="3">-</font><span style="font: 7pt 'Times New Roman'"> </span></span><font size="3">Report is grouped on {Scenario Name}</font></font></p><p style="margin: 0in 0in 0pt 0.5in; text-indent: -0.25in; tab-stops: list .5in" class="MsoNormal"><font face="Times New Roman"><span><font size="3">-</font><span style="font: 7pt 'Times New Roman'"> </span></span><font size="3">Left side dates on any of the tables is {Version Date}</font></font></p><p style="margin: 0in 0in 0pt 0.5in; text-indent: -0.25in; tab-stops: list .5in" class="MsoNormal"><font face="Times New Roman"><span><font size="3">-</font><span style="font: 7pt 'Times New Roman'"> </span></span><font size="3">Dates on the top header on any of the tables is {Fsc Week End Dt}</font></font></p><p style="margin: 0in 0in 0pt 0.5in; text-indent: -0.25in; tab-stops: list .5in" class="MsoNormal"><font face="Times New Roman"><span><font size="3">-</font><span style="font: 7pt 'Times New Roman'"> </span></span><font size="3">Other formulae used in this report are:</font></font></p><p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="Times New Roman" size="3">1) = ({Query1.Demand Qty})/100000</font></p><p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="Times New Roman" size="3">Numerical values displayed in the "Original values" table.</font></p><p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="Times New Roman" size="3">2) =</font></p><p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="Times New Roman" size="3">if {Query1.Scenario Name} = 'DLYPRD:ASCP-PRD:PRD' </font></p><p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="Times New Roman" size="3">THEN mid ({Query1.Scenario Name},13,3)</font></p><p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="Times New Roman" size="3">ELSE mid ({Query1.Scenario Name},13,6)</font></p><p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="Times New Roman" size="3">Second column with value PRD in any of the tables.</font></p><p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="Times New Roman" size="3">3) {next qty} = if not onlastrecord then next({@ShortDemandQty}) else 0;</font></p><p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="Times New Roman" size="3">(used in the "next values vertically" table)</font></p><p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="Times New Roman" size="3">4) - running total to calculate horizontally</font></p><p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="Times New Roman" size="3">Evaluate - For each record</font></p><p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="Times New Roman" size="3">Reset - On change of field: {Version Date}</font></p><p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="Times New Roman" size="3">5) - running total to calculate vertically.</font></p><p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="Times New Roman" size="3">Evaluate - For each record</font></p><p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="Times New Roman" size="3">Reset - On change of field: {Fsc Week End Dt}</font></p><font face="Times New Roman" size="3"> </font> <p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="Times New Roman" size="3">In this report design, when I go and change the Sort order in the Record Sort Expert, some of the values go for a toss. I got two cases where the vertical values are correct in one case and horizontal values are correct in another case.</font></p><font face="Times New Roman" size="3"> </font><strong><font size="3"><font face="Times New Roman">First Case:</font></font></strong> <p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="Times New Roman" size="3">Cumulative vertical values are correct.</font></p><p style="margin: 0in 0in 0pt" class="MsoNormal"> </p><font face="Times New Roman" size="3"> </font><strong><font size="3"><font face="Times New Roman">Second Case:</font></font></strong> <p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="Times New Roman" size="3">Cumulative horizontal values are correct.</font></p><p style="margin: 0in 0in 0pt" class="MsoNormal"> </p><font face="Times New Roman" size="3"> </font><strong><span style="color: blue"><font size="3"><font face="Times New Roman">Is there any way to consistisize both the horizontal and vertical running totals. I even tried forcing the evaluate & reset like below and clearing the record sort order, but it did not work:</font></font></span></strong><strong><span style="color: blue"><font face="Times New Roman" size="3"> </font></span></strong> <p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="Times New Roman" size="3">1) - running total to calculate horizontally</font></p><p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="Times New Roman" size="3">Evaluate - On change of field: {Fsc Week End Dt}</font></p><p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="Times New Roman" size="3">Reset - On change of field: {Version Date}</font></p><p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="Times New Roman" size="3">2) - running total to calculate vertically.</font></p><p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="Times New Roman" size="3">Evaluate - On change of field: {Version Date}</font></p><p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="Times New Roman" size="3">Reset - On change of field: {Fsc Week End Dt}</font></p><font face="Times New Roman" size="3"> </font><strong><span style="color: blue"><font size="3"><font face="Times New Roman">And one more observation on the running total, how it works in the crosstab is, the total runs likes a spiral rather than resetting at the column or row level. Is there any way to restrict this?</font></font></span></strong><font face="Times New Roman" size="3"> </font> <p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="Times New Roman" size="3">3) {next qty} = if not onlastrecord then next({@ShortDemandQty}) else 0;</font></p><p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="Times New Roman" size="3">(used in the "next values vertically" table)</font></p><font face="Times New Roman" size="3"> </font> <p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="Times New Roman" size="3">For example, onlastrecord does not seem to work on the "next values vertically" crosstab, rather brings the record from the next column.</font></p><p style="margin: 0in 0in 0pt" class="MsoNormal"><font face="Times New Roman" size="3">For 3/7/2007 - 01/APR/07, the value is 157.84 which is incorrect and should be 0.</font></p><strong><span style="color: blue"><font size="3"><font face="Times New Roman">I need to get a next on the running total. Next (fld) doesnot work for running totals. Please guide me, how to get the next values for the running total fields.</font></font></span></strong>
Post Author: redtop6683
CA Forum: Formula
Whoops I guess I should have mentioned that I've already tried using Sum and Round(Running Total, 2) and haven't had any luck.
I also should have mentioned that Groupings 1 and 2 are sums, and that Running Total is a running total that changes on every change of the grouping. There are 4 groupings.
Grouping 1 (Employee Name)
Grouping 1.1 (Shift)
Grouping 1.2.1 (Payroll Department Code)
Grouping 1.2.1.1 (Description)
Below these 4 groupings is where the running total is. The issue is that in the footer of grouping 1 is a field that sums the elapsed hours for the particular employee by each payroll department code, these are then summed using the running total. The issue is as stated in the earler post that I can round these individual sums on the groupings, but I get the number on my running total to round differently as you can see by the earlier post's example.
Thanks for the help.
~Jason -
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 -
Post Author: dbmngleaf
CA Forum: Formula
I'm using Crystal Report XI and I have a report where I need to supress data and show a running count for just the records that are showing on the report. My supression works fine but the running count isn't. I've seen that you can't use the built in running totals when you're supressing data and I seen that you can create 3 formulas to get this to work however it isn't working.
My formulas are:
total_init
WhilePrintingRecords;
numberVar overall_total:=0;
total_calc
WhilePrintingRecords;
numberVar overall_total;
overall_total:=overall_total+1;
total_disp
WhilePrintingRecords;
numberVar overall_total;
The formulas are totaling everything including the supressed records. How do I get it to count just the records that are displaying? Thanks for any help in advance.Post Author: yangster
CA Forum: Formula
you're almost therethe only thing you need to is change your evaluation formula, you don't have an if statement in there to tell it to ignore the records you don't want to countwhat you have right now is it will increment by 1 for every recordtotal_calc
WhilePrintingRecords;
numberVar overall_total;if not(whatever you are supressing on) thenoverall_total:=overall_total+1;so this will count every time the record is not supressed -
Post Author: jligget
CA Forum: Formula
Good afternoon,
I have a 2 running totals that sums either debits or credits. There may be cases where there are no credits so in place of the sum I need to place zero's.
The running total has a formula in it of {@detail transaction code} in ['22', '32'] and if so it then sums the amount field. (22 or 32 desingate a credit - I have another running total for a debit)
The problem is that if no credits exist nothing gets summed and I get spaces in my running total field. How can I make it so that it will display zeros instead?
Thanks,
JeannettePost Author: Jeffs23
CA Forum: Formula
I had some minor issues with my formulas and Running Total so I modified them alittle:
@TotalTime
If {Data.ApptTime} = 0 then 0else {Data.ApptTime}
@Converted Time
If {#RTotal0} = 0 then "--"else ToText(Truncate({#RTotal0}/60),0,"") + " Hour(s), " + ToText(Remainder({#RTotal0},60),0,"") + " Min(s)"
My running total stayed the same.......
Field to Summarize - @TotalTime Type of Summary - sum Under Evaluate Section: "Use a Formula":(onfirstrecord or{Data.ResourceStart} <> previous({Data.ResourceStart}) or{Data.Resource} <> previous({Data.Resource}) ) andminimum({Data.ApptKind},{Data.ResourceStart}) = 1 AND maximum({Data.Column},{Data.ResourceStart}) >= '1' Reset on change of field {Data.Resource}
Some fake sample data:
Resource = Francis, William MD
Facility 1: River Oaks Main Clinic
Facility 2: Western Medical Hospital
Date of Service = 10/25/2007
From 7:15 am to 11:45 am, Patients were treated at Facility 1: River Oaks Main Clinic *** (total time = 4 hours 30 min)
From 12:15 pm to 1:00 pm, Patients were treated at Facility 2: Western Medical Hospital *** (total time = 45 min)
From 1:00 pm to 3:15 pm, Patients were treated at Facility 1: River Oaks Main Clinic *** (total time = 2 Hours 15 min)
The report should tell me Total time at River Oaks Main Clinic = 6 Hours 45 min and 45 min for Western Medical Hospital. What it currently is doing, is reporting the 6 Hours 45 min on the River Oaks Main Clinic and 7 Hours 30 min on the Western Medical Hospital. The time for this facility should be 45 minutes, yet its taking the full provider time and throwing it into this second facility. I am assuming its because the Running total tells it "Reset on change of field {Data.Resource}". Somehow, I need it to evaluate on both the Resource and the Facility. Any suggestions? -
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 / 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 -
Report layout and running totals
Hello everyone!
I need to pick some brains. I need some help. I came across with a report where I have to add running totals for each state for years 2012, 2013, 2014 and to next column I have to calculate change in percentage annually. Basically, below the summary table sums the totals for the same years.
Here how it look on excel
I am trying to do the same thing on Crystal reports. Here how it looks:
On the Crystal Reports I have to put that summary table for each state. on the beginning or on the end of the each state.
Any help or suggestion is greatly appreciated.hi Korhan,
you can do this by Inserting a Cross-tab on the Report Footer. have a look at the attachment...extract the contents and change the .txt extension to .rpt.
right click on the cross-tab and choose Cross-tab Expert. note that there are two Sums on the same field.
exit the cross-tab expert and right click on one of the summaries under YTY change and choose Format Field. under the Common tab look at the formula in the Display String dialogue. this is the formula that does all of the work. it uses the 2nd Sum value in the cross-tab expert and uses the Grid value functions that are available for the cross-tab. you can also go to the online help for crystal reports to learn more about these grid value functions.
you can go back to the cross-tab exerpt then the Customize Style tab to see all of the various formatting options that were used on the cross-tab.
cheers,
jamie
Maybe you are looking for
-
Deploying ear file to Web AS server
Hi, I am trying to deploy the ear file from Netweaver Developer Studio using "Administrator " user. After Successfull deployment I logon to Enterprise portal server, immediatelty asked passwd expired & change password.I have changed that! Then I logg
-
All My Files no longer showing in Finder
Instead all that's there is a Search bar with 'This Mac' and 'All My Files' on it and blank below it. Before it always used to show, well, all my files! What can have happened? I don't recall playing around with it or anything. This isn't really a se
-
Different between LEAVE SCREEN & SET SCREEN 0
Hi there, I have a program where I have the main screen and another one. to call the secondary screen I used CALL SCREEN 0200. However I have doubt when I'm executing the BACK. I don't know the different between SET SCREEN 0. and LEAVE SCREEN 0100. w
-
Shotwell crash/freeze when video files present in preview from camera
Presence of any .avi video file in Shotwell causes the following error: Error in `shotwell': malloc(): memory corruption (fast): 0x00000000087c9080 I've searched around and found many problems with Shotwell and videos, and other errors like mine, but
-
MacBook + OS X 10.5 + Freecom Network Disk -- No data shown on connect
Hello, Since I use MacOS X 10.5 I cannot connect to my Freecom Network Drive 500GB via SMB anymore. Unter 10.4 it worked fine. Now, OS X 10.5's finder shows the network drive and connects (Username "admin", PW: "my-password") but does not show any of