Print Page | Close Window

Fórmula

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=19871
Printed Date: 05 May 2024 at 1:09am


Topic: Fórmula
Posted By: carine
Subject: Fórmula
Date Posted: 08 Aug 2013 at 4:51am
Good morning!

I need your help.

I have a list relatótrio that manages employee and every manager and dates of absences of employees
Group 1: Managers.
Group 2: Employees.

Put the sum of faults of each group of employees. Only when an employee has group manages more than 3 absences the group manages the field "Quantity lapsed" = 1.

example:

 Data            
missing
-------------------------------------------------- ---------------------------
Group 1: Department Manages
Group 2: Luiz

05/07/2013        0
06/07/2013        1
07/07/2013        1
08/07/2013        0

Sum total fault: 2

Group 1: Department Manages
Group 2: Luiz

05/07/2013        1
06/07/2013        1
07/07/2013        1
08/07/2013        1

Sum total fault: 4

Grand total = 6         Fouls employee with more than 3 absences = 1

How would this formula to add only the employees who have more than 3 absences?



Replies:
Posted By: lockwelle
Date Posted: 08 Aug 2013 at 5:03am
shared variable:
group header 2:
shared numbervar absence:=0;
"" //hide the zero

detail:
shared numbervar absence;
if fault then absence := absence + 1; //i don't know what makes a fault
""//hide the increasing number

group footer 2:
shared numbervar totAbsence;
shared numbervar absence;
if absence >= 3 then totAbsence := totAbsence + 1;
"" // hide the incrementing total

grand total display:
shared numbervar totAbsence

HTH


Posted By: DBlank
Date Posted: 08 Aug 2013 at 6:06am
if i understand your question you might also consider using the built in Running Total feature.
field to summarize=employee
type= distinctcount
evalaute = use a formula
sum(absent,employee)>3
reset=never
place in report footer


Posted By: lockwelle
Date Posted: 08 Aug 2013 at 7:31am
ahh...there you go with those running totals ;)
one of these days I'll master them


Posted By: carine
Date Posted: 08 Aug 2013 at 10:42am
Tested this beauty there.

But what I exactly want is for him to show me that total by group and at the end show the grand total.

As it stands it just brings the grand total.

How would I do?


Posted By: lockwelle
Date Posted: 08 Aug 2013 at 10:44am
probably 2 running totals, one as is...grand total.
the other would reset every group...place in the group footer.


Posted By: DBlank
Date Posted: 08 Aug 2013 at 10:46am
yep


Posted By: carine
Date Posted: 08 Aug 2013 at 10:54am
não sei como fazer.  =(

Poderia fazer o passo a passo como você fez anteriormente?


Posted By: DBlank
Date Posted: 08 Aug 2013 at 10:58am
field to summarize=employee
type= distinctcount
evalaute = use a formula
sum(absent,employee)>3
reset= on group - select group 1
place in Group 1 footer


Posted By: carine
Date Posted: 09 Aug 2013 at 4:55am
I still can not do.

I would have to create the same formulas?
------
shared variable:
group 2 header:
shared absence numbervar: = 0;
"" / / Hide the zero

detail:
shared numbervar absence;
then if fault absence: absence = + 1 / / i do not know what makes the fault
"" / / hide the Increasing number

group 2 footer:
shared numbervar totAbsence;
shared numbervar absence;
if absence> = 3 then totAbsence: totAbsence + = 1;
"" / / Hide the full incrementing

grand full display:
shared numbervar totAbsence
-----

  and only change the positioning of the formula "grand full display:
shared numbervar totAbsence "putting her in group 1?


Posted By: lockwelle
Date Posted: 09 Aug 2013 at 5:00am
Sorry, DBlank and I thought that you were using running totals.

For shared variables you would some more formulas.

The grand total would stay as it is, you would make the group 2 footer something like:
shared numbervar g1tot;
shared numbervar totAbsence;
shared numbervar absence;
if absence> = 3 then (
   totAbsence: totAbsence + = 1;
   g1tot := g1tot + 1;
);
"" / / Hide the full incrementing

in g1 header
shared numbervar g1tot := 0;
//

in g1 footer
shared numbervar g1tot

HTH



Print Page | Close Window