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

Need a footer to count only certain detail lines 2

Status
Not open for further replies.

melburstein

Technical User
Aug 29, 2000
246
US
Not
Completed Completed

Employee 1 D X
Employee 2 D X
Employee 3 D X

Total Count GF1 1 2

Above is a report that I am creating for the HR Dept. It
indicates if an employee has completed training within 30 days of his/her hire date. I am not showing all of the columns. I have a formula that computes the number of days and puts the "X" value in the appropriate column. The detail lines work fine. But I want the Group Footer to count the detail lines that have a "X".
 
Try creating Running Total formulas based on the number of days formula.

Use a count, and the Evaluate->Use a Formula would have something like the following:

// less than 10 days
{@DaysCount} > 0
and
{@DaysCount} < 10

//Less than 20 days
{@DaysCount} > 9
and
{@DaysCount} < 20

etc.

-k
 
I am a fairly new user and perhaps need a more detailed explanation. My @DaysCount formula works and is used with a couple other foumulas to place the string "X" in the appropriate column on the detail line, depending on the value returned by @DaysCount. I understand your suggestion that I use Running Totals for GF1, and that I put a Formula in the Evaluate section, but I do not know how to construct it so that it will count only those detail lines within the group that have an "X". One column only has "X's" for those employees who attended within 30 days; another for those who attended within 60 days and another for those who did not attend at all.

Mel
 
You would use multiple Running totals, one for each day range of interest. Assuming that {@DaysCount} returns a value, use:

// Within 30 days
{@DaysCount} < 31

// Within 60 days
{@DaysCount} > 30
and
{@DaysCount} < 61

// Didn't attend
// Within 30 days
{@DaysCount} = 0

-k
 
Sorry to be so thick headed, but I already have separate columns with X's in the column to indicate which range that employee falls into. My question is what kind of formula do I need in the evaluate section of the running total screen inorder to count the X's in each column?
 
SV was suggesting that you use the same logic in the formula section as you used to place the "X" in the columns.

You could also use your existing formulas. You already have three formulas: {@within30}, {@within60}, and {@didnotattend} that are assigning the "X"s in different columns. Create three running totals, one for each column, and use the following syntax in the running total formula section, substituting the correct formula name:

{@within30} = "X"

If this doesn't work, we would need to see the contents of your formulas.

-LB
 
You had stated that the {@DaysCount} has the number of days, so the syntax I supplied should work.

Did you try it? If so, did it error or produce the wrong results?

Try posting the contents of the formulas, perhaps this is more complex than I had envisioned.

-k
 
Thank you, and thank you lbass, I will try it Wednesday morning.
 
A combination of the suggestions worked!!!

Thank You, "lbass". I setup my running totals as you suggested. For example:
{@NotCompleted} = "X"
{@CompletedWithin30Days} = "X"
{@CompletedWithin60Days} = "X"

Thank You, "synapsevampire". Your advice was very helpful. It helped me understand how Running Totals work when a Formula is used to Evaluate. Unfortunately, Formulas, such as the following did not work, returning a value of zero instead of a count of the X's:
{@DaysCount} < 31.

Again, what did work were formulas such as the following:
{@CompletedWithin30Days} = "X"

Mel
 
The theory works, but since you never posted what was in the formula, it's hard to guess what you really have in there.

Glad that it worked out.

-k

 
Just for kicks here is what is in a couple of the formulas:

@DaysCount =
DateDiff("d",{Command.DATE-HIRED},PAEMPTRACK.END-DATE})

PAEMPTRACK.END-DATE is the date of employee orientation.

@CompletedWithin30Days =
If (Not IsNull({PAEMPTRACK.END-DATE})
and {@DaysCount} < 31) then "X"

Within the Running Total for the Within30 column, I have:

{@CompletedWithin30Days} = "X"

Again, I want to thank you for your help that really got me on the right track.

Mel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top