Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

forcing a different evaluation time in a running total

Status
Not open for further replies.

hmoe

Programmer
Mar 10, 2006
9
US
I'm running version 10 and my report needs to calculate a percentage using a grand total that is created with a running total. It looks like the totals and percentages are being calculated during the same pass. I need the grand total for the # ordered to calculate first so that I can use that number to figure out the percentages. The calculations are all running totals that appear in the group footer and the grand totals are in the report footer. I need the percentage to read 66.7%, 0%,33.3%. I've tried several things and the way that is working now, is it has 100% on the Visa line and 33.3% on the JCB line. It looks like it is dividing 2/2 and then 1/3. This is what the columns I'm working with look like:
Tender Type # Orders $Orders % by Type
Visa 2 3,000
Discover 0 0
JCB 1 1,500
Total 3 4,500
 
Have you tried using the "whilereadingrecords" and "whileprinting" records options?

Alternatively you should also be able to use

EvaluateAfter({@Formula})

-- Jason
"It's Just Ones and Zeros
 
Running Totals are performed in the last pass, so yuo have intentionally used a method that does so, hence you can't change it.

Rather than chatting about what isn't working, successful posts state the environment and requirements:

Database/connectivity used
Example data (this doesn't mean what your report looks like, it means a representation of the data)
Expected output (what you need produced)

Instead of a running total, group by the tender type, palce the field in the details, right click the field and select insert->summary and set it to for the group.

Do the same for a Insert->Summary-Distinct Count fo the Order numbers.

To get the percentages, you can either do so from within the insert sumamry function again and select show as a precentage of the total, otr create a formula such as:

if sum({table.orderamount}) > 0 then
sum({table.orderamount},{table.tendertype})/sum({table.orderamount})*100
else
0

-k
 
Thanks for the responses. I've tried the Evaluate after and whileprinting record options and those didn't work. I've also tried to create the summaries which works for the first few columns that I have on my report but some of the columns have conditions in them and I'm unable to satisfy the conditions using summaries. I need to calculate the total orders and amount for certain fraud types. That's why I used a running total because it allowed me to specify the fraud type in the evaluate secction.
 
Stating that you have conditions that you're unable to satisfy isn't useful unless you state what they are.

You can add the fraud types to the formulas as well,as in:

if {table.fraudtypein} [1,2,3]
and
{table.tendertype} = "Visa"
then
{table.field}
else
0

Then use that as a summary. And a summary field as described of sum({table.orderamount}) used with your running totals in a group footer should also work.

Since you didn't post your requirements accurately, you received an inaccurate solution, try taking the time to state specifics as requested in my previous post.

-k
 
I apologize for not following the forum posting rules. This is my first time working in Crystal and posting onto a forum. The requirements are to create a report that calculates the total orders and total dollar amounts of fraud charge backs by credit tender type and product group. The first column of the report shall have the grouping of credit cards, the second column total orders of all chargebacks, the third column the dollar value of all chargebacks by credit card, the fourth column the % by credit card type, the fifth column total orders with fraud type = 211, the sixth column the total dollar value of orders with fraud type 211, and the seventh column the % by card type with fraud type = 211

Credit Total # Total $ % by Type # Orders $ Orders %
Type Orders Value in 211 in 211 by
Type
Visa 2 500 66.7% 1 500 50%
Amex 1 100 33.3% 1 100 50%
___________________________________________________________
Total 3 600 100% 2 600 100%

The user also would like to double click on the credit type and be able to view the different products that make up each credit entry. Ex. when she click Visa she wants to see that the products associated with Visa are, Womens Shoes, cosmetics, etc.

I hope this is descriptive enough for you.
 
The clicking stuff isn't going to readily happen, but you might use a drill down or a on demand subreport to accomplish this. but one posting at a time.

Also note that I asked for your database type, example data, and expected output, you only posted the latter. This isn't a forum rule, this is common sense to provide your environment.

btw, I already gave you the answer, use the method I had described in my first post to supply everything EXCEPT the fraud qualified data, then use my second post to qualify the 211 data:

Order$
if {table.fraudtype} = 211
and
{table.tendertype} = "Visa"
then
{table.field}
else
0

OrderQty
if {table.fraudtype} = 211
and
{table.tendertype} = "Visa"
then
1
else
0

Now you have fields that you can drop into the details, right click and select insert summary on to provide the qualified data. Then you can delete them.

Of course depending upon how your data looks, which we have no idea of, you might receive duplicates on the OrderQty formula above.

I would suggest that you consider that nobody out here knows what your data looks like, and it would help everyone if you SHOW an example in future posts rather than trying to describe it.

-k
 
Thanks for the formulas and I am in the process of writing these formulas for all of the card types that are in the field in the Teradata database. I have one question, once I write the formulas for Visa, Amex, Mastercard, etc. How do I get the appropriate function to appear next to the correct credit card grouping? I currently have one group (Group#1)which has all of the named credit cards in the specified order tab. If I put all of the funtions in the details, then all of the totals will appear on all of the credit lines.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top