Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Formula Reset Post Reply Post New Topic
Author Message
dmkanz
Newbie
Newbie


Joined: 27 Sep 2016
Online Status: Offline
Posts: 18
Quote dmkanz Replybullet Topic: Formula Reset
    Posted: 19 Oct 2017 at 8:16am
I have created a formula that extracts a contact by job listing but I need to be able to reset for each iteration.

Report Layout

Group by Customer
Group by Job

Report Example

ABC Customer
12345 Job 12345 Contact Name A
67890 Job 67890 Contact Name B

My formula Contact is

if {Description} like "*Client Reference*" or {Description} like "*Marketing Reference*" then {FirstName} + {LastName} else "Unassigned"

The problem I am having is if the customer has only one job listed it works just fine. But if the customer has multiple jobs it makes all the contacts as unassigned or blank except one.

I believe I need to reset the formula for each job iteration.

Thanks in advance

DMKanz
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet Posted: 23 Oct 2017 at 7:54am
Is the contact assigned to the job or to the customer?

How are you linking to the table where the customer info is located?

-Dell
IP IP Logged
dmkanz
Newbie
Newbie


Joined: 27 Sep 2016
Online Status: Offline
Posts: 18
Quote dmkanz Replybullet Posted: 31 Oct 2017 at 3:49am
Dell

The contact is associated with the job

Thanks,

DMKanz
IP IP Logged
dmkanz
Newbie
Newbie


Joined: 27 Sep 2016
Online Status: Offline
Posts: 18
Quote dmkanz Replybullet Posted: 31 Oct 2017 at 4:23am
Dell

I am grouping by Customer and then by Job. A job can have multiple contacts.

i.e.

Customer ABCo

Job    Contact    Description
1234   Jones
1234   Smith
1234   Anderson
5678   Carlson    Client Contact
9012   Larson
9012   Hanson     Client Contact


What I am trying to do is display all jobs by contact that is "Client" but I also want to display all jobs that do not have a contact designated as "Client"

i.e.

Customer ABCo

Job    Contact        Description
1234   "Unassigned"
5678   Carlson        Client Contact
9012   Hanson        Client Contact

I tried a formula but I cannot get it to cycle through the contacts. It looks at the first contact and then moves on giving me an unassigned even though one of the contacts is designated as "Client:

Thanks in advance

DMKanz
IP IP Logged
dmkanz
Newbie
Newbie


Joined: 27 Sep 2016
Online Status: Offline
Posts: 18
Quote dmkanz Replybullet Posted: 31 Oct 2017 at 4:45am
Any help would be much appreciated

Thanks,

DMKanz
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet Posted: 31 Oct 2017 at 4:57am
Will the value for the description ever be null? If so, you have to specifically look for that.

Here's what I would do to solve the issue:

1. Add a group on the Description field and make the sort "In specified order" so you can sort to the top the contact types that you want to show in the report. Add any contact types that you do not want to see to an "Others" group (these are all options on the group configuration screen.)

2. Put the data in the Job group header instead of details. Suppress the contact group header and details.

3. Modify your formula to be something like this:
[code]
if not IsNull({Description}) then
if {Description} like "*Client Reference*" or {Description} like "*Marketing Reference*" then
    {FirstName} + {LastName}
    else "Unassigned"
else "Unassigned"

When fields can have a null value, you MUST check for null BEFORE checking for any other value.

-Dell
IP IP Logged
dmkanz
Newbie
Newbie


Joined: 27 Sep 2016
Online Status: Offline
Posts: 18
Quote dmkanz Replybullet Posted: 31 Oct 2017 at 5:13am
That worked!

This forum is awesome - Dell thank you so much for the help!

I added the description group by and sorted by descending and it worked perfectly.

DMKanz
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.