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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with reports

Status
Not open for further replies.

jaa69

Programmer
Nov 12, 2001
85
US
I'm having a little problem with a report. I have different salesman (This can change). I just want total at the bottom of the page for each salesman. This part is not a problem ex:

Salesman A
orders 30,000 quotes 60,000 percentage 50%
10,000 100,000 10%


Totals 40,000 160,000 **** Problem

I can use the sum to get the orders and quotes correctly. However I need to get the percentage like above based on the totals not adding the percentages it should not be 60%
it should 25%. The sum totals the divsion results. Any help please
 

Assuming that you have created a group footer on salesman to get salesman wise totals, what you can do is use the same formula or field used for the percentage column in the detail line of the report copy it to the goup footer, click on the Calculations button, change the 'Reset' to salesman and set the 'Calculate' button to Sum.



 
Hi jaa69,

Create report variables.. tOrders, tQuotes...
Make the value to store = Orders and Quotes respectively.
Make reset at as your group for salesman.
Select the SUM option and initial value to store as 0.

Now in the place of % use tOrders and tQuotes instead of the fields. DO NOT SUM in the calculation part of it. Leave it as nothing.

The report will work correctly now. :)
ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com

 
jaa69

In order to get the total per salesman you need to create a group with the salesman's name or number. Place a field in the group footer (amount), in the field's calculation select SUM and have it reset at the group level.


In order to get the percentage of the amount for each group (percentage of the total sales), you have to get the total sales calculated before the report shows. To do that, in the Dataenvironment of the report, in the BeforeOpenTables you can open your table that contains the amounts and create a public Array and calculcate it there:
PUBLIC ARRAY myTotal[1]
select orders
SUM AMOUNTS TO ARRAY myTotal

And in the textbox that will hold your percentage put:
(AMOUNTS)/IIF(myTotal[1] = 0, .00001, myTotal[1])* 100

Using the format 999.99% Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Thank you all.

I guess I will have t pre calculate before I run the report. I figured I can do this but I was hoping I could do it right in the report. Yes I have already created the grouping which is fine except the percentage.

Thanks all again.
 
jaa69

I figured I can do this but I was hoping I could do it right in the report.

The solution I suggested is right in the report, it the dataenvironment of the report. Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top