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

how to create a grand sum activities?

Status
Not open for further replies.

taterday

Programmer
Jan 28, 2009
183
US
I am at a loss on how to do this. I have a number of people charging to activities. These are calculated fields using the activity table (activity code) and hours worked table by activity.

When the report completes, the user wants a total by activity code combining all hours worked within the company. The problem is there is about 50 activity codes. The management can change and add codes at will.

codes can be:
DD/DD
PA
TTFA:TT

I have the individual activity and group totals. I need to be able to grand total each of the activity codes.

Someone please help me started.
 
What version of crystal? You should never ask a question without supplying this information.

Is the field a database field or a formula field? If it is a formula field, please post the formula.

Software Sales, Training, Implementation and Support for Macola, Synergy, and Crystal Reports. Check out our Macola tools:
 
You could probably insert a crosstab in the report footer that uses activity code as a row and sum of hours as the summary field.

-LB
 
using CR 9 with a SQL express database.

The activity codes is a field in the SQL table. The summary that I need is a calculated variable by their activity code.

this would be the variable I would need to sum and print in the activity code order when the report completes.

local numbervar budget_hours_tehours;
budget_hours_tehours:=Sum ({@budget_hours}, {@actid})-{@Total_Tehours_by_ACT}

budget hours is the sum of hours assigned to the project budget within the activity code.

{@actid} this field is obtained by comparing two tables by the project number. If one does not have the activity code, then the other does. The activity code is then placed in the variable for use later.

{@Total_Tehours_by_ACT} This is hours charged to the project by activity code.

(The data isn't as clean as I would like. I have no control over the data.)

I have not used a crosstab. I will look into this.

Thank you guys for your responses.

 
Please show the content of the formulas (and of any nested formulas).

-LB
 
You did not post the content. LB is asking for the content of:

{@budget_hours}
{@actid}
{@Total_Tehours_by_ACT}

If you post this, we can likely help you.

Software Sales, Training, Implementation and Support for Macola, Synergy, and Crystal Reports. Check out our Macola tools:
 
Hope this is clear.
{@budget_hours} HOURS budget for the project by activity code
{@actid} activity code
{@Total_Tehours_by_ACT} hours actual worked for the project by activity code

{@budget_hours}:= value in the a table. budget hours is the sum of hours assigned to the project budget within the activity code.

{@actid}:=ACTIVITY CODE this field is obtained by comparing two tables by the project number. If one does not have the activity code, then the other does. The activity code is then placed in the variable for use later.

{@Total_Tehours_by_ACT}:=TRANSACTION HOURS This is hours charged to the project by activity code.
 
The actual formulas--not a description of them.

-LB
 

Budget_Hours
{Budget.budget_hours}

storing the budget_hours on the group break of project

{@Total_Tehours_by_ACT}
Sum ({TEntry.TeHours}, {@actid})

local numbervar budget_hours_tehours;
budget_hours_tehours:=Sum ({@budget_hours}, {@actid})-{@Total_Tehours_by_ACT}

The actid is just storing the activity code into the variable.

 
I'm not sure why you are putting fields into formulas, rather
than using them directly. The nesting of formulas just obfuscates the actual calculation, IMHO.

It sounds like this:

Sum ({@budget_hours}, {@actid})-{@Total_Tehours_by_ACT}

...is really the same as this:

sum({Budget.budget_hours},{@actid})-
sum({TEntry.TeHours},{@actid})

...and we still don't have the content of {@actid}.

I think you can just insert a crosstab, use {@actid} as your row field, and add the following formula {@diff} as your summary field:

{Budget.budget_hours}-{TEntry.TeHours}

In the crosstab expert, select sum as the summary field. Place the crosstab in the report footer.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top