Welcome, Guest. Please Login.
05/17/24 at 00:55:25
News:
Home Help Search Login


Pages: 1
Send Topic Print
Trouble with total (Read 2286 times)
David Waldmann
Active Member
*****


Live to work, or
work to live?

Posts: 1924
Gender: male
Trouble with total
10/17/06 at 11:39:33
 
I have a report that shows how much our SIMPLE IRA matching contribution is supposed to be, which we do quarterly. I thought it was working fine until last quarter I noticed that one employee's match was less than their contribution when it should have matched. I dicovered that it was because I was basing the formula that compared their contribution to the maximum match of 3% was based on each individual pay check, and one week they had worked low hours.
 
So, I re-did the report by subtotaling the total pay and contribution of each employee for the quarter and using those numbers. The problem I'm running into is that I can't total the resulting answer. The new field does not offer "Subtotal, etc" as a right-click option, and when I try to force one using the formula editor it says "The summary could not be created". I also tried a trick learned at the CR training class in Nashua of telling it to add those numbers together last, by using "WhilePrintingRecords", but got the same error.
 
I also tried using a custom Subtotal, but the created field is not in the list of available ones to choose from.  
 
For the four times a year I run it I suppose it'd be quicker to just manually total it up, but it bugs me - I think it should be able to be done. Any ideas?
Back to top
 
 

David N Waldmann
President
Vermont Hardwoods
Chester, VT

Evo-ERP, 5 user
IST Build: 3/4/19, patched 04/30/19
Pervasive v11.31
Server 2012 / Win10 x64
Crystal Reports v11
Email WWW   IP Logged
kevind
Active Member
*****


I was more than
willing to
"pony up",
how b'out U?

Posts: 639
Gender: male
Re: Trouble with total
Reply #1 - 10/17/06 at 12:07:24
 
David,
If you use a Group to group the information for each employee, you should
be able to use Insert->Summary Choose the field or formula
from the dropdown list that you want to subtotal.  Specify that
this value be placed in the Group Footer.
 
For the Grand Total, use Insert->Summary and Choose the
same field as you did for the Group Summary.  Specify that this
summary should be placed in the Report Footer.
 
I just tested this by using BKARCUST:
1. I Grouped by the first 2 characters of the customer code.
2. I created a formula that represents 1/2 of their outstanding invoices.
3. I then inserted a Summary Field in the footer of the Group that summarized the formula.
4. Then I inserted a Summary in the Report Footer that Summed the same formula.
 
Hope this helps.
Back to top
 
 

Kevin Damke
Spectronics Corporation
ISTECH 2004.1 7/26/13 SP1 - 20 user
Evo-ERP Build 7/25/13 T7 -7i R6 - 3 user
(Prev version was 2004.1 10/24/12)
(All Patches Installed as of 7/26/13)
Pervasive 2000i SP4 - Crystal Reports V10
Email WWW   IP Logged
David Waldmann
Active Member
*****


Live to work, or
work to live?

Posts: 1924
Gender: male
Re: Trouble with total
Reply #2 - 10/17/06 at 13:12:46
 
The subtotal I'm trying to sum is not a CR Subtotal, but a conditional formula:
 
If Subtotal A > Subtotal B * .03  
then Subtotal B  * .03
else Subtotal A
 
This formula works fine by group, but it cannot be then summed, for sum reason Tongue
 
Maybe I need to think of this some other way.
Back to top
 
 

David N Waldmann
President
Vermont Hardwoods
Chester, VT

Evo-ERP, 5 user
IST Build: 3/4/19, patched 04/30/19
Pervasive v11.31
Server 2012 / Win10 x64
Crystal Reports v11
Email WWW   IP Logged
dameng
Senior Member
****


DBA / EVO Software
Consultant

Posts: 275
Gender: male
Re: Trouble with total
Reply #3 - 10/20/06 at 06:00:29
 
since you are using a conditional formula, then you will need to create and use a Manual Running Total.
 
Back to top
 
 

Dave Mengelkamp
Digital Consulting
760.832.2536
davemeng@earthlink.net
Email WWW   IP Logged
David Waldmann
Active Member
*****


Live to work, or
work to live?

Posts: 1924
Gender: male
Re: Trouble with total
Reply #4 - 10/20/06 at 06:16:37
 
Quote from dameng   on 10/20/06 at 06:00:29:
since you are using a conditional formula, then you will need to create and use a Manual Running Total.

 
That's what I remembered from your class, but
Quote from David Waldmann   on 10/17/06 at 11:39:33:
I also tried using a custom Subtotal, but the created field is not in the list of available ones to choose from.

 
 ???
Back to top
 
 

David N Waldmann
President
Vermont Hardwoods
Chester, VT

Evo-ERP, 5 user
IST Build: 3/4/19, patched 04/30/19
Pervasive v11.31
Server 2012 / Win10 x64
Crystal Reports v11
Email WWW   IP Logged
kevind
Active Member
*****


I was more than
willing to
"pony up",
how b'out U?

Posts: 639
Gender: male
Re: Trouble with total
Reply #5 - 10/20/06 at 09:09:30
 
Generally speaking, when you create a manual subtotal, you create 3 different formulas:
One that clears a Global numbervar that represents the total.
One that accumulates the total.
One that you use to show the total.
 
All of these formulas should have whileprintingrecords; on the  first line
so that they get processed while the report output is being generated.
 
Each formula has the global numbervar defined so that they all access
the same memory used to store the subtotal.
 
Here is a simple report that uses BKARCUST to subtotal and grandtotal
OUTINV by state.
 
http://spectronics.com/dba/Subtotal_example.rpt
 
(Right Click and Save File As .. to get a copy of the file)
Back to top
 
 

Kevin Damke
Spectronics Corporation
ISTECH 2004.1 7/26/13 SP1 - 20 user
Evo-ERP Build 7/25/13 T7 -7i R6 - 3 user
(Prev version was 2004.1 10/24/12)
(All Patches Installed as of 7/26/13)
Pervasive 2000i SP4 - Crystal Reports V10
Email WWW   IP Logged
David Waldmann
Active Member
*****


Live to work, or
work to live?

Posts: 1924
Gender: male
Re: Trouble with total
Reply #6 - 10/20/06 at 10:14:23
 
Kevin,
 
Thanks for your help, but I can't open the report - I get an "Invalid TLV Record" error. I tried opening it directly and it apparently tried to use Java to display it  
 
I've tried doing this about half a dozen different ways including using numbervar and reset. I always end up with the SUBtotal I want, but then I can do nothing with it.
 
This is my latest attempt, based on the CR Help page for running totals using a formula:
 
RUNNING_TOTAL
WhilePrintingRecords;
CurrencyVar Amount;
Amount := if {#Total_Pay} * .03 > {#Employee_Portion}
then {#Employee_Portion} else {#Total_Pay} * .03;

 
AMOUNT_RESET
WhilePrintingRecords;
CurrencyVar Amount := 0;

 
AMOUNT_DISPLAY
WhilePrintingRecords;
CurrencyVar Amount;

 
The AMOUNT_DISPLAY cannot be summed. I even tried writing a formula:
 
whileprintingrecords;
Sum ({@Amount_Display})

 
It says "The summary / running total could not be created"
Back to top
 
 

David N Waldmann
President
Vermont Hardwoods
Chester, VT

Evo-ERP, 5 user
IST Build: 3/4/19, patched 04/30/19
Pervasive v11.31
Server 2012 / Win10 x64
Crystal Reports v11
Email WWW   IP Logged
David Waldmann
Active Member
*****


Live to work, or
work to live?

Posts: 1924
Gender: male
Re: Trouble with total
Reply #7 - 10/20/06 at 11:02:14
 
What I meant was, first I downloaded it and got the TLV error, then I tried opening it directly and Java tried displaying it in my browser.
Back to top
 
 

David N Waldmann
President
Vermont Hardwoods
Chester, VT

Evo-ERP, 5 user
IST Build: 3/4/19, patched 04/30/19
Pervasive v11.31
Server 2012 / Win10 x64
Crystal Reports v11
Email WWW   IP Logged
kevind
Active Member
*****


I was more than
willing to
"pony up",
how b'out U?

Posts: 639
Gender: male
Re: Trouble with total
Reply #8 - 10/20/06 at 13:16:53
 
Sorry about that ... I forgot I have Apache setup to serve up .RPT files.
 
Try this ... It is a Zip file with the Report inside.
 
http://spectronics.com/dba/Subtotal_example.zip
 
(Right Click and Save File As .. to get a copy of the file)
Back to top
 
 

Kevin Damke
Spectronics Corporation
ISTECH 2004.1 7/26/13 SP1 - 20 user
Evo-ERP Build 7/25/13 T7 -7i R6 - 3 user
(Prev version was 2004.1 10/24/12)
(All Patches Installed as of 7/26/13)
Pervasive 2000i SP4 - Crystal Reports V10
Email WWW   IP Logged
dameng
Senior Member
****


DBA / EVO Software
Consultant

Posts: 275
Gender: male
Re: Trouble with total
Reply #9 - 10/23/06 at 04:34:01
 
RUNNING_TOTAL  
WhilePrintingRecords;  
CurrencyVar Amount;  
Amount := if {#Total_Pay} * .03 > {#Employee_Portion}  
then {#Employee_Portion} else {#Total_Pay} * .03;  
 
keep your conditional formula in it's own formula name, so that way it is able to process and return a value.
 
use a seperate formula for the running total, and reference the conditional formula.
 
then in the runningtotal formula use
whileprintingrecords;
currencyvar amount;
amount := amount + condformula;
amount;
 
Back to top
 
 

Dave Mengelkamp
Digital Consulting
760.832.2536
davemeng@earthlink.net
Email WWW   IP Logged
David Waldmann
Active Member
*****


Live to work, or
work to live?

Posts: 1924
Gender: male
Re: Trouble with total
Reply #10 - 10/25/06 at 08:56:27
 
Sorry, Kevin, but now I get a "version error message".
 
I don't know if I'm just stupid or what. I could not get any of these ideas to work. I did eventually get the info I wanted, in a kind of comvoluted way. I set up two running subtotals - one that reset on every group and one that didn't.
 
Thanks for all the help.
Back to top
 
 

David N Waldmann
President
Vermont Hardwoods
Chester, VT

Evo-ERP, 5 user
IST Build: 3/4/19, patched 04/30/19
Pervasive v11.31
Server 2012 / Win10 x64
Crystal Reports v11
Email WWW   IP Logged
kevind
Active Member
*****


I was more than
willing to
"pony up",
how b'out U?

Posts: 639
Gender: male
Re: Trouble with total
Reply #11 - 10/25/06 at 11:58:35
 
Duh  undecided ... that was a great idea!!!
 
Back to top
 
 

Kevin Damke
Spectronics Corporation
ISTECH 2004.1 7/26/13 SP1 - 20 user
Evo-ERP Build 7/25/13 T7 -7i R6 - 3 user
(Prev version was 2004.1 10/24/12)
(All Patches Installed as of 7/26/13)
Pervasive 2000i SP4 - Crystal Reports V10
Email WWW   IP Logged
Pages: 1
Send Topic Print