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!

Formula not bringing in data

Status
Not open for further replies.
Sep 16, 2005
191
US
Is there something wrong with my formula? It shows blank on the result of my crystal 10 report.

Employee Name : If {CD_EMPLOYEE.DEPT} = "012" then
{CD_EMPLOYEE.FIRST_NAME} + {CD_EMPLOYEE.LAST_NAME}


I need to create a report that would display all the employee in each department.

Example of output:

Department 12
Ann Lastname
Tom Lastname
James lastname

Department 13
Sam lastname
Jone lastname

Right now, I have two group header a, b. Group header a is department 12. Group header b is Department 13. Then I bring "Employee Name" into Group header a with the above formula but no data is display when I run the report. Did I do something wrong?

I am new to crystal and not sure where or why it does not display my result. Please help. Thanks in advance.
 
Dear AlreadyLost,

I have a question for you. In Crystal a Group Header A and B would indicate that you have inserted a section into an existing group.

Why did you do this? And, what field are you actually grouping on?

Commonly, you would just group on the department field. Since, it appears that there is an employee dpt field then the employees would naturually show up under their respective department.

Also, you would generally place the data you wanted to see for the employees for a department in the details section.

Your formula would simply be

{CD_EMPLOYEE.FIRST_NAME} + {CD_EMPLOYEE.LAST_NAME}

If you display data from the employee records in a department group header, you would get just the first record for the group and if displayed int he header you would get just the last record for that group.

Why don't you indicate what your report should look like...

regards,

ro

Rosemary Lieberman
rosemary-at-microflo.com, Microflo provides expert consulting on MagicTSD and Crystal Reports.

You will get answers more quickly if you read this before posting: faq149-3762
 
Hi,
The layout seems odd for what you want to do..
Create just 1 group on the {CD_EMPLOYEE.DEPT} field then, in its details place the formula ( but leave out the Dept # test):
Code:
@FullName
Trim({CD_EMPLOYEE.FIRST_NAME}) + ' ' + Trim({CD_EMPLOYEE.LAST_NAME})

This will list each employee in the department shown in the GH

[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Thanks Rosemary for reply. First, I am very new to crystal and to answer your question:

Why did I put them on the group header? I thought group by would give me all the employee that are in department 012.

What am I group by? I am grouping by the formula "Employee Name" (If {CD_EMPLOYEE.DEPT} = "012" then
{CD_EMPLOYEE.FIRST_NAME} + {CD_EMPLOYEE.LAST_NAME}).

I need to create a report to show the activities of each employee group by department. To track their activities.

My report should only display two department 012 and 013 and all employee that is in department 012 should show up under department 12. All employee with department 013 should show up under department 013.

Example of final result of report:
Department 12
Employee Name that belong to depart 12, assigment, total completed, percent completed, Total entered, total cleared.

Department 13
Employee Name that belong to depart 13, assigment, total completed, percent completed, Total entered, total cleared.
 
Just create a formula called "empoloyee"

//@employee
{CD_EMPLOYEE.FIRST_NAME} + {CD_EMPLOYEE.LAST_NAME}


Insert a group by on {CD_EMPLOYEE.DEPT}

Place {@employee} in the detail section

Refresh report and voila

LW

 
0Dear AlreadyLost,

As stated by Turkbear and KsKid, do the following:

Group by :{CD_EMPLOYEE.DEPT}

This will create a group header for the department field.

Create a Formula:

{CD_EMPLOYEE.FIRST_NAME} + {CD_EMPLOYEE.LAST_NAME}
and place the formula and the other fields into the detail section of the report.

Now, since you state that you only want the two departments, click on Report/Edit Selection Formula/Record and insert the following:

{CD_EMPLOYEE.DEPT} in["012","013"]

That will only return records where the Dept is 012 or 013.

Your report will look like this:

Department 12
Employee Name assigment total completed percent completed Total entered total cleared

Department 13
Employee Name assigment total completed percent completed, Total entered total cleared

regards,
ro

Rosemary Lieberman
rosemary-at-microflo.com, Microflo provides expert consulting on MagicTSD and Crystal Reports.

You will get answers more quickly if you read this before posting: faq149-3762
 
Thanks.. but it show all departments. How do I filter to only show the two department that I need?
 
I think I got it.. To filter, I need to use selection formula? Thanks for all the inputs..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top