XL Reporter - Cumlative Running Total
Hi All
I'm running XL Reporter on SBO and trying to place a excel formula to have a running total against a sales spread sheet, but it isn't working and i wonder if any of you people could help me?
i'll show what im trying to achieve, Items and Row Total are taken from SBO so id like a column beside Row Total to add the 640
R
O (Column A) (Column B) (Column C)
W Items Row Total Cumlative Total ( What i need)
1 =ixDimGet("DVD Cases") =ixGet("640.00") 640 +B1
2 =ixDimGet("Blank DVD") =ixGet("340.00") 980 B2C1
3 =ixDimGet("Manuals") =ixGet("795.00") 1775 B3C2
4 =ixDimGet("Reg Cards") =ixGet("1437.33") 3212.33 B4C3
The result that returns is just the value of Column B and the row total. If have tried everything but to no avail.
Hope this makes sense
Thanks in Advance.
Edited by: Philip Eller on May 30, 2008 9:02 AM
Hi
If I understood you correctly this is how you do it:
=IF(D7="Row Total",D8,SUM($D$8:D8))
I assumed that you will have a column header just above your first value in the expanding rows, so the first value of the running total will be equal to the value of the 1st row in your report. The $ signs will anchor the first value in D8 and the second D8 without the $ signs will expand with your rows.
Regards
Daan
Similar Messages
-
Need to sum hh:mm:ss in crystal report using Running Total Fields
Hello,
I am new to .Net and crystal reports so please go easy on me.
I am trying to develop a crystal report using Visual Basic .NET. I have a column which displays the "Inbound Time" in "hh:mm:ss" format. I have to sum the total inbound time and display it.
I tried using the Running Total and i am not successful.
Here is the code which I am using in the Running total
WhilePrintingRecords;
if isNumeric({Report3;1.TotalInboundTime}) then
{Report3;1.TotalInboundTime}
else
CStr ({Report3;1.TotalInboundTime});
NumberVar array test2 := [ToNumber(left(CStr({Report3;1.TotalInboundTime}),2)),ToNumber(mid(Cstr({Report3;1.TotalInboundTime}),4,2)),ToNumber(right(Cstr({Report3;1.TotalInboundTime}),2))];
StringVar test1 := CStr( (ToNumber(test2[1])3600)+(ToNumber(test2[2])60)+(ToNumber(test2[3])));
InboundTime is the time field which is in "hh:mm:ss" format.Hello Bharathi,
There are a couple of KBs about this. I haven't tested them myself, but you could give them a try:
[How sum multiple time fields in Crystal Reports|http://technicalsupport.businessobjects.com/KanisaSupportSite/search.do?cmd=displayKC&docType=kc&externalId=c2008378]
[Creating a running total to show the difference between two datetime fields |http://technicalsupport.businessobjects.com/KanisaSupportSite/search.do?cmd=displayKC&docType=kc&externalId=c2010261]
[Totalling time values that are stored as numbers in the database|http://technicalsupport.businessobjects.com/KanisaSupportSite/search.do?cmd=displayKC&docType=kc&externalId=c2005576]
Cheers,
Fritz -
Financial Reporting Studio - Running Total
I am trying to build a waterfall / step chart in Financial Reporting Studio to visualize large movements between prior year and current year profit by profit type. For it, i require a 'running total' of profit type movement. I burst the profit type dimension out on row 2 and i want to keep a running total formula calculation
e.g.
Last Year
This Year
Movement
Total Profit
[Profit Type].Level1 drilldown
Total Profit
I want to keep a running total of the movement in Row 2. How can i do this?Insert Formula Row and give it formula.
-
How to create crystal report 2008 with running totals?
i want to create a report with running totals as follows:
Balance B/F 1000.00
Invoices Receipts Running B/ce
100 1100
500 600
500 100
300 400
400 0
The B/F field is passed as a Parameter.Hi panayiotis,
In order to create a running total you need to have absolute clarity on the following:
(i)Whether the running total be set on change of field/record/group.
(ii)Whether the running total be set on change of record/group OR never.
Make the appropriate choice.
Apply this to the field to summarize and type of summary in Running Total Pane.
Thanks,
Amogh. -
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 -
I am fairly new to Crystal Reports and Running Totals. I have a group setup that is based on the number of days a loan is late. For example, I have three buckets (30 Days, 60 Days, 90 Days). In setting up the group, I put the group in specific order and decided to exclude the other loans that are less than 30 days. I am trying to get a total $ amount of all the loans instead of just the loans in the buckets. I have searched forums and a Crystal 2008 book trying to figure this out. I tried using a Running Total with the Running Total expert but it is still giving me the same grand $ total that I have for the groups I selected. Any ideas? I am bit confused as to the multipassing of the data. Should I keep the groups setup the way I have them or use the select expert (etc).
Thanks, I am a newbie.i suggest manual running totals, more accurate and if you have duplicate values the summary option will duplicate the data
create 3 formuls
i reset
whileprintingrecords;
numbervar x:= 0;
this gets placed in the group header
calculate
whileprintingrecords;
numbervar x:= x + field or formula;
this gets placed next to the field or formula you want calculated
display
whileprinitngrecords;
numbervar x;
x
this gets displayed in the footer of where the reset is (header)
using manual running totals, if you have data on the report you dont want included you can create a formula that will only calc based upon only what should be included. -
Running total required but with different timing
Hi All:
I am using Oracle9i Enterprise Edition Release 9.2.0.6.0
I want to write a query to display the statistics report with running total.
I have written following query that return last 60 minutes activities.
SELECT se.tserv_id,
sum(decode(eu.category,'I',1,0)) Imp,
sum(decode(eu.category,'E',1,0)) Exp,
count(*) Total
FROM service_events se, equipment_uses eu
WHERE se.performed BETWEEN trunc(sysdate-60/1440,'mi')
AND trunc(sysdate,'mi')
AND se.tserv_id IN ('EXM','GROUNDED')
AND eu.gkey = se.equse_gkey
AND eu.category IN ('I','E')
GROUP BY se.tserv_id;
now I want to write a query that shows me the result of above query and running total as well
But the different between current activity and running total is as follows
Current Activity = Last 60 minutes activity
Running Total = Total activities from the 08:00 am till sysdate.
for example if this query executed on 11:00 am then the current activity values must be from 10:00 am to 11:00 am and the running total values must be from 08:00 am to 11:00 am
The reason for running total starts at 08:00 am is that the shift starts from 08:00 am to next day 07:59 am.
Can I write one single query for this?
Similarly running total values must be start from last day 08:00 am to current date and time when I executed this query from 00:00 to 08:00 (12 midnight to 8am)
if difficult then plz let me know that how can I find that if the time is from 00 hrs to 08 hrs then start time must be the last date 08:00 am to the current date and time.
Thanks
HassanDear Frnak
Thanks for your reply and help
Its really did what I want
I mean to say that the result format is correct but the value of Total_day column is not correct.
Following is the sample data from 19-Jun-2008 08:00 AM to 20-JUN-2008 08:00 AM
TSERV_ID EQUSE_GKEY PERFORMED
===============================================
EXM 5188958 19-Jun-2008 8:00:32 AM
EXM 5185586 19-Jun-2008 9:03:34 AM
EXM 5181960 19-Jun-2008 9:03:35 AM
EXM 5173333 19-Jun-2008 9:03:35 AM
EXM 5188263 19-Jun-2008 9:08:49 AM
GROUNDED 5174055 19-Jun-2008 9:10:29 AM
GROUNDED 5152887 19-Jun-2008 9:10:29 AM
GROUNDED 5187512 19-Jun-2008 9:10:29 AM
GROUNDED 5196303 19-Jun-2008 9:27:41 AM
EXM 5196370 19-Jun-2008 9:29:50 AM
EXM 5172045 19-Jun-2008 10:01:23 AM
GROUNDED 5196269 19-Jun-2008 11:11:29 AM
GROUNDED 5200219 19-Jun-2008 11:24:39 AM
GROUNDED 5185246 19-Jun-2008 12:06:30 PM
GROUNDED 5190134 19-Jun-2008 12:09:27 PM
GROUNDED 5190475 19-Jun-2008 12:09:27 PM
GROUNDED 5156065 19-Jun-2008 12:26:49 PM
GROUNDED 5132287 19-Jun-2008 1:56:44 PM
EXM 5189203 19-Jun-2008 2:29:17 PM
EXM 5180158 19-Jun-2008 3:27:03 PM
EXM 5149310 19-Jun-2008 3:37:31 PM
EXM 5196303 19-Jun-2008 3:42:48 PM
EXM 5192768 19-Jun-2008 4:03:51 PM
EXM 5174055 19-Jun-2008 4:14:23 PM
EXM 5200231 19-Jun-2008 4:45:51 PM
EXM 5157151 19-Jun-2008 4:51:06 PM
EXM 5159930 19-Jun-2008 5:01:36 PM
EXM 5185237 19-Jun-2008 5:01:37 PM
EXM 5195434 19-Jun-2008 5:01:37 PM
EXM 5152887 19-Jun-2008 5:06:49 PM
EXM 5196269 19-Jun-2008 5:06:49 PM
EXM 5187512 19-Jun-2008 5:17:26 PM
EXM 5190134 19-Jun-2008 5:59:24 PM
GROUNDED 5101919 19-Jun-2008 6:44:36 PM
GROUNDED 5101918 19-Jun-2008 6:44:37 PM
GROUNDED 5101913 19-Jun-2008 6:44:37 PM
EXM 5185735 19-Jun-2008 6:46:38 PM
GROUNDED 5195475 19-Jun-2008 6:47:11 PM
GROUNDED 5195361 19-Jun-2008 6:47:12 PM
EXM 5132608 19-Jun-2008 7:02:23 PM
GROUNDED 5195334 19-Jun-2008 7:10:32 PM
GROUNDED 5190558 19-Jun-2008 7:10:32 PM
EXM 5183029 19-Jun-2008 7:33:53 PM
EXM 5183480 19-Jun-2008 7:39:12 PM
EXM 5189566 19-Jun-2008 8:00:11 PM
EXM 5181825 19-Jun-2008 8:15:57 PM
EXM 5183537 19-Jun-2008 8:15:57 PM
EXM 5180210 19-Jun-2008 9:08:27 PM
GROUNDED 5193136 19-Jun-2008 9:58:23 PM
EXM 5171510 19-Jun-2008 10:21:59 PM
EXM 5185615 19-Jun-2008 10:48:14 PM
EXM 5184737 19-Jun-2008 10:53:29 PM
EXM 5195475 19-Jun-2008 11:51:16 PM
EXM 5195476 20-Jun-2008 12:01:46 AM
EXM 5190558 20-Jun-2008 12:12:17 AM
EXM 5196473 20-Jun-2008 12:54:19 AM
EXM 5183204 20-Jun-2008 1:20:34 AM
GROUNDED 5192844 20-Jun-2008 1:28:24 AM
GROUNDED 5174238 20-Jun-2008 1:28:24 AM
GROUNDED 5193127 20-Jun-2008 1:28:24 AM
GROUNDED 5185794 20-Jun-2008 1:29:09 AM
GROUNDED 5192895 20-Jun-2008 3:04:23 AM
GROUNDED 5193039 20-Jun-2008 3:04:23 AM
GROUNDED 5195447 20-Jun-2008 3:04:23 AM
GROUNDED 5190228 20-Jun-2008 3:04:24 AM
GROUNDED 5179370 20-Jun-2008 3:04:24 AM
GROUNDED 5190289 20-Jun-2008 3:04:24 AM
GROUNDED 5174065 20-Jun-2008 3:04:24 AM
GROUNDED 5192862 20-Jun-2008 5:04:42 AM
GROUNDED 5199903 20-Jun-2008 5:04:42 AM
EXM 5178176 20-Jun-2008 6:30:29 AM
EXM 5185161 20-Jun-2008 6:46:14 AM
EXM 5180226 20-Jun-2008 6:46:14 AM
GROUNDED 5202026 20-Jun-2008 7:03:14 AM
EXM 5101912 20-Jun-2008 7:07:14 AM
GROUNDED 5176763 20-Jun-2008 7:25:27 AM
GROUNDED 5185494 20-Jun-2008 7:25:27 AM
EXM 5185295 20-Jun-2008 7:38:46 AM
EXM 5173837 20-Jun-2008 7:49:15 AM
GKEY CATEGORY
=================
5101912 I
5101913 I
5101918 I
5101919 I
5132287 I
5132608 I
5149310 I
5152887 I
5156065 I
5157151 I
5159930 I
5171510 I
5172045 I
5173333 I
5173837 I
5174055 I
5174065 I
5174238 I
5176763 I
5178176 I
5179370 I
5180158 I
5180210 I
5180226 I
5181825 I
5181960 I
5183029 I
5183204 I
5183480 I
5183537 I
5184737 I
5185161 I
5185237 I
5185246 I
5185295 I
5185494 I
5185586 I
5185615 I
5185735 I
5185794 I
5187512 I
5188263 I
5188958 I
5189203 I
5189566 I
5190134 I
5190228 I
5190289 I
5190475 I
5190558 I
5192768 I
5192844 I
5192862 I
5192895 I
5193039 I
5193127 I
5193136 I
5195334 I
5195361 I
5195434 I
5195447 I
5195475 I
5195476 I
5196269 I
5196303 I
5196370 I
5196473 I
5199903 I
5200219 E
5200231 E
5202026 EAnd I used the same query suggested by you.
WITH s AS(
SELECT se.tserv_id , eu.category ,
CASE
WHEN se.performed BETWEEN
to_date('&target_dt','DD-MON-RRRR HH24:MI') - (1/24)
AND to_date('&target_dt','DD-MON-RRRR HH24:MI')
THEN 1
ELSE 0
END AS in_hour ,
CASE
WHEN TRUNC (se.performed - (8/24)) = TRUNC (to_date('&target_dt','DD-MON-RRRR HH24:MI')
- (8/24))
THEN 1
ELSE 0
END AS in_day
FROM service_events se , equipment_uses eu
WHERE eu.gkey = se.equse_gkey
AND eu.category IN ('I', 'E')
AND se.tserv_id in ('EXM','GROUNDED')
SELECT tserv_id,
SUM (DECODE (category, 'I', in_hour)) AS imp_hour,
SUM (DECODE (category, 'E', in_hour)) AS exp_hour,
SUM (in_hour) AS total_hour,
SUM (in_day) AS total_day
FROM s
GROUP BY tserv_idNow you have the sample data for almost 24 hours
Let me clear it again
When I executed this query at 20-JUN-2008 09:00 AM it gives me following result (that is accurate)
TSERV_ID IMP_HOUR EXP_HOUR TOTAL_HOUR TOTAL_DAY
EXM 2 0 2 3
GROUNDED 1 0 1 8When I executed this query between 20-JUN-2008 00:00 to 20-JUN-2008 08:00
then system must show the Total_Day value from 19-JUN-2008 08:00 to current date and time. e.g
I executed this query at 20-JUN-2008 06:00 AM it gives me following result:
TSERV_ID IMP_HOUR EXP_HOUR TOTAL_HOUR TOTAL_DAY
EXM 0 0 0 44
GROUNDED 2 0 2 35Now here you can see that the value of Total_Day is not as accurate as I required:
EXM = 44 and GROUNDED = 35
these values are between 19-JUN-2008 00:00 to 20-JUN-2008 06:00 (that is wrong in my case)
The values of total_day should be as follows as 8 hours from 00:00 to 07:59 AM fall in the shift of 18-JUN-2008 not in 19-JUN-2008
From 19-JUN-2008 08:00 to 20-JUN-2008 06:00
EXM: 38
GROUNDED: 32
Plz note that this result is required because in our company the shift starts from 08:00 AM and ends 07:59 AM next day
I hope you will be more clear now and there is no confusion anymore.
Plz let me know if you still confused.
Brgs, -
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 -
Showing running totals on AR statatement Report
Hi All I need assistance in populating the Running totals on AR statement Report , I am trying to calculate the running total on the RDF using the (sum Over Partition ) and Not on the RTF template please assist .
here is my query below :
select customers.customer_name,
detail.customer_id,
detail.customer_site_use_id,
:CP_ACC_NAME,
:CP_ACC_NUM,
:CP_BRNCH_NAME,
:CP_COL_EMAIL,
:CP_COL_PHONE,
:CP_BRANCH_NR,
decode( (select meaning
from ar_lookups
where lookup_type = 'INV/CM/ADJ' and lookup_code = detail.class), 'Payment', apply_date, trx.trx_date) TRX_DATE,
trx.INVOICE_CURRENCY_CODE,
trx.INVOICE_CURRENCY_CODE INVOICE_CURRENCY_CODE_BAL,
NVL(trx.term_due_date,trx.TRX_DATE) term_due_date,
detail.customer_id cst_id,
detail.customer_site_use_id cst_site_id,
detail.customer_trx_id,
detail.trx_number,
(select meaning
from ar_lookups
where lookup_type = 'INV/CM/ADJ' and lookup_code = detail.class) class,
detail.amount_full_original,
detail.end_bal * -1 , (detail.end_bal + detail.amount_full_original)* -1 closing_balance ,
detail.amount_full_original - detail.the_order * -1 closing_bal,
(detail.amount_full_original - detail.running_total) running_total ,
detail.running_tot ,
customers.customer_name address1,
customers.address1 address2,
customers.address2 address3,
customers.address3 address4,
customers.city||' '||customers.state address5,
customers.country||' '||customers.postal_code address6,
addr.address1 rm_address1,
addr.address2 rm_address2,
addr.address3 rm_address3,
addr.address4 rm_address4,
addr.address5 rm_address4,
:p_as_of_date_from date_from,
to_char(to_date(:p_as_of_date_to,'DD-MON-YYYY'),'DD-Mon-YYYY') date_to,
addr.org_id rm_org_id,
rtrim(to_char(sysdate,'DD')||' '||to_char(sysdate,'Month'))||' '||to_char(sysdate, 'YYYY') curr_date
from (select customer_id, CUSTOMER_SITE_USE_ID, trx.CUSTOMER_TRX_ID,trx.TRX_NUMBER, null apply_date,ps.class,ps.AMOUNT_DUE_ORIGINAL amount_full_original, the_trx.end_bal,the_trx.running_total , the_trx.running_tot , 1 the_order
select customer_trx_id, sum(acctd_end_bal) end_bal , running_total , running_tot
SELECT ps.customer_trx_id ,
sum(ar_calc_aging.begin_or_end_bal(ps.gl_date,ps.gl_date_closed,
NULL,to_date(:p_as_of_date_from))
* ps.amount_due_remaining) start_bal,
sum(ar_calc_aging.begin_or_end_bal(ps.gl_date,ps.gl_date_closed,
NULL,to_date(:p_as_of_date_to))
* ps.amount_due_remaining) end_bal,
sum(ar_calc_aging.begin_or_end_bal(ps.gl_date,ps.gl_date_closed,
NULL,to_date(:p_as_of_date_from))
* ps.acctd_amount_due_remaining) acctd_start_bal,
sum(ar_calc_aging.begin_or_end_bal(ps.gl_date,ps.gl_date_closed,
NULL,to_date(:p_as_of_date_to))
* ps.acctd_amount_due_remaining) acctd_end_bal ,
(sum(ar_calc_aging.begin_or_end_bal(ps.gl_date,ps.gl_date_closed,
NULL,to_date(:p_as_of_date_from))
* ps.amount_due_remaining) + sum(ar_calc_aging.begin_or_end_bal(ps.gl_date,ps.gl_date_closed,
NULL,to_date(:p_as_of_date_to))
* ps.acctd_amount_due_remaining) ) running_total ,
sum((sum(ar_calc_aging.begin_or_end_bal(ps.gl_date,ps.gl_date_closed,
NULL,to_date(:p_as_of_date_from))
* ps.amount_due_remaining) + sum(ar_calc_aging.begin_or_end_bal(ps.gl_date,ps.gl_date_closed,
NULL,to_date(:p_as_of_date_to))
* ps.acctd_amount_due_remaining) )) over (partition by ps.customer_trx_id order by ps.customer_trx_id)running_tot
FROM ar_payment_schedules_all ps
WHERE ps.payment_schedule_id+0 > 0
--JF2 AND ps.gl_date_closed >= to_date(:p_as_of_date_from)
AND ps.class IN ( 'CB', 'CM','DEP','DM','GUAR','INV')
AND ps.gl_date <= to_date(:p_as_of_date_to)
and org_id = nvl(:P_ORG_ID,org_id)--1246
--and customer_id = :p_customer_id --1075
--and CUSTOMER_SITE_USE_ID = :p_customer_site_id --1066
--and customer_trx_id = 66291
--'|| l_ps_org_where ||'
GROUP BY ps.customer_trx_id ,ps.acctd_amount_due_remaining , ps.gl_date,ps.gl_date_closed ,ps.class , rownum
ps.customer_trx_id ,
sum(ar_calc_aging.begin_or_end_bal(ps.gl_date,ps.gl_date_closed,
ra.gl_date,to_date(:p_as_of_date_from))
* ( ra.amount_applied + NVL(ra.earned_discount_taken,0)
+ NVL(ra.unearned_discount_taken,0))) start_bal,
sum(ar_calc_aging.begin_or_end_bal(ps.gl_date,ps.gl_date_closed,
ra.gl_date,to_date(:p_as_of_date_to))
* ( ra.amount_applied + NVL(ra.earned_discount_taken,0)
+ NVL(ra.unearned_discount_takenHi
Yes i would like more help as i have never used group by roll up before
SELECT p.employee_number,
p.full_name employee_name,
DECODE (p.sex, 'M', 'Male', 'F', 'Female') gender,
(DECODE (p.per_information4,
'01', 'Indian',
'02', 'African',
'03', 'Coloured',
'04', 'White')) race,
p.original_date_of_hire,
a.effective_start_date startdate_current_position,
RTRIM (SUBSTR (ps.NAME, 1, INSTR (ps.NAME, ';')), ';') current_position,
ho.NAME current_organization,
xx_return_company_name(a.person_id, a.effective_start_date) current_company,
RTRIM (SUBSTR (ps1.NAME, 1, INSTR (ps1.NAME, ';')),';') previous_position,
ho1.NAME previous_organization,
xx_return_company_name(a1.person_id, a1.effective_start_date) previous_company,
a1.effective_start_date startdate_prev_position
FROM per_assignments_v2 a,
per_assignments_v2 a1,
per_all_people_f p,
per_all_positions ps,
per_all_positions ps1,
hr_all_organization_units_tl ho,
hr_all_organization_units_tl ho1
WHERE a1.person_id = a.person_id
AND NVL (a1.position_id, 9) <> a.position_id
AND a1.effective_end_date = a.effective_start_date - 1
AND p.person_id = a.person_id
and ho.ORGANIZATION_ID=ps.ORGANIZATION_ID
and ho1.ORGANIZATION_ID=a1.ORGANIZATION_ID
AND a.effective_start_date BETWEEN p.effective_start_date AND p.effective_end_date
AND a.position_id = ps.position_id
and p.EMPLOYEE_NUMBER not in ('1','2','3')
AND a1.position_id = ps1.position_id(+)
order by p.full_name -
Running total in report footer returning inaccurate result
Post Author: smarkta
CA Forum: Formula
I am writing a report that contains 3 groups. I have created running totals for each group that are accurate by selecting the group to evaluate and reset on. now I need to basically sum the results of the all the group running totals but have had no success. any tips on how to do this would be greatly appreciated.
ThanksPost Author: Charliy
CA Forum: Formula
Were you doing a Distinct Count? Did you have a formula on the Running Total? What is there about the Group Totals that make them different than the final total. -
Oracle report running total Resseting balance
Dear All,
I am developing report on Oracle R12 fixed Assets, I have to calculate the running total for each asset.
In brief
Asset 1
cost Deprciation Adjusted Cost
50 - 2 48
48 -5 45
45 - 4 41
I achieved that by using
if :p_val is null then
:result := nvl(:cost,0)-nvl(:depriciation,0);
:P_val :='5';
return :result;
else
:result := nvl(:result,0)-nvl(:depriciation,0) ;
return :result;
end if;
working fine
But problem is when the next asset start on same report
Asset 2
cost Deprciation Adjusted Cost
100 5 36
it substracts the last total (running total of previous asset with depriciation which was 41 in this example).
Oracle Champs pl advice me how to solve this.
I really dont got any idea how to solve this.
thanksDear,
Thanks for your reply , in your reply what you said I tried this but in pl/sql I am not actually achieving the result. The balance is not resetting at next group if you give one accurate line it would be really helpfull.
thanks -
Crystal reports - charting a variable to simulate a running total
I have 2 sets of data as below :
units
costs
What I am trying to do is generate a chart that for each month, reports the result of the formula
sum of costs to date / sum of units to date
Ideally, I would create 2 running totals
RT costs
RT units
then a formula avg. cost to date = RT costs/ RT units
and then for each month (x axis of the chart) plot avg/ cost to date
BUT - crystal won't plot a data set based on running totals.
So, I created a field with a psudo running total
i.e.
whileprintingrecords;
numbervar unitsum;
unitsum:=unitsum+units
and similar for the costs. Variable called costsum.
Then a variable field
whileprintingrecords;
numbervar results;
results:=costsum/unitsum
So I though I could then plot the field with the variable results in it in the chart. But no, I cannot see the field name in the data select list.
Please advise how I can create my chart.
Thanks
Edited by: newbyr on Jul 7, 2010 12:20 PMWith the best will in the world, I realise that charting does not like running totals, What I am looking for is a workaround, or clever way of circumventing the problem.
Before posting I did extensively search the forum and saw the link that DebiHerbert has suggested, and it is of no help at all.
Thanks
Edited by: newbyr on Jul 9, 2010 2:40 PM -
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? -
Getting running total formula result at the beginning of the report
Hello All,
I am having an inquiry that if I can get a grand total in the report footer to the report header.
The grand total is not a direct sum. I am using three formulas
the first formula:
@reset Group Header
whileprintingrecords;
numbervar sumpct4;
if not inrepeatedgroupheader then
sumpct4 := 0;
the second formula: Details section
whileprintingrecords;
numbervar sumpct4 := sumpct4 + {@Total_Market}; // {@Total_Market}; = Amount+ Interest
numbervar grtotal4 := grtotal4 + {@Total_Market};
Group Footer
whileprintingrecords;
numbervar sumpct4;
Report Footer
whileprintingrecords;
numbervar grtotal4;
All that I need is to show the total which is in the report footer at the top of the page where I am having a summary.
So, can you please help me.
Thanks
Edited by: maas maas on Sep 8, 2010 12:48 PMHello my friend,
I want this to be controlled in crystal.
Is there is a way to get the grand total by using multiple formulas or any other way?
Here is the structure of my report:
Group Header 1: CCY
Group Header 2:Type
@reset Group Header
whileprintingrecords;
numbervar sumpct4;
if not inrepeatedgroupheader then
sumpct4 := 0;
Group Header 3A: Deal No
Group Header 3B: Deal No (subreport to get the {@amount} for each deal)
I will pass the end_date from the main report to subreport and I will get the sum(amount) for each deal between date (1-1-2008) to end_date. The sum will be as a shared variable to the {@amount} formual in the main report.
Details:
Deal No, {@amount}, {@Price}, {@market}, {@Total_Market}
{@Price}: if {table.price} = 0 then
100
else {table.price}
{@market}: if Type <> "DEP" then
({@amount}*{@Price})/100
else
{@amount}
{@Total_Market}:{@market}+ {@Price}
Running formula to get Total_market: Details section
whileprintingrecords;
numbervar sumpct4 := sumpct4 + {@Total_Market};
numbervar grtotal4 := grtotal4 + {@Total_Market};
Group Footer 3B: Deal No
Group Footer 3A: Deal No
Group Footer 2:Type
In this group I am placing a running total formula:
whileprintingrecords;
numbervar sumpct4;
Group Footer 1: CCY
Report Footer:
@grand_Total
whileprintingrecords;
numbervar grtotal4;
Now, i want this @grand_total formula result to be shown in Group Header 1: CCY.
I tried to insert a subreport at the beginning which it is a copy of the main report, but I did not get the coorec t result because I am getting the {@amount} from a subreport and in crystal I can't insert a subreport in an existing subreport. -
Hi,
Can any one tell me how to create a running total in Oracle reports. I have two fields pulled in the SQL called CR and DR. I want to do the running total at report level. Here what I want
CR------DR-------RTOTAL
20-----10---------10 ( here the RTOTAL Field is (20 - 10) )
30-----15---------25 ( here the RTOTAL Field is (30 - 15) + 10)
50-----25---------50 ( here the RTOTAL Field is (50 - 25) + 25)
75-----35---------90 ( here the RTOTAL Field is (75 - 35) + 50)
Thanks
-FerozHello,
You can use the following SQL query :
select cr,dr,cr-dr cr_minus_dr from <table> ...
and create a Summary Column in the Reports :
Source : the field cr_minus_dr
Function : Sum
Regards
Maybe you are looking for
-
Possible to link the two tables?
Dear All, I am currently trying to create a report where the user will enter in the customer code and then using discounts on item groups to create a sales price (list price - customer discount = sales price). I'm currently trying to do this in cryst
-
How to add different bulleting shapes in thunderbird. Currently it is showing a dot.
i need to add detail with different bulleting shapes in Thunderbird is there any addon which helps me give different shape for bulleting.
-
Hi! I have a simple question (I think). I have edited some pictures in iPhoto '11 and would like to have them as a standard .jpg or whatever. How do I do? Jonas
-
I need to download mozilla firefox version 2.0, where can I find it?
I can only find version 7, but I need 2.0.
-
I would like to keep firefox out of my dock so that customers do not click on it. Can I do this while I am still using it on another screen?