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!

Duplication Error 2

Status
Not open for further replies.

irenavassilia

Programmer
Jun 19, 2007
101
Hi I have a Crystal Report v10 where in my detail line I am displaying many records based on the Itemcode and Itemdesc fields.

Inside my Detail a/section expert/suppress/x-2/ I have this code: ({UXDETAIL.ItemDesc} = next({UXDETAIL.ItemDesc}))

Everything works fine unless I have this senerio - where there is a section of itemdesc that are all exactly the same, there for it suppresses all of the details, which is incorrect because I need at least 1 detail line for that itemdesc to show.

Does that make sense?

I need some advise please, thank you.
 
I suspect this is happening because the next group contains the same value (assuming you have a group), so change your suppression formula to:

not onlastrecord and
{UXDETAIL.ItemDesc} = next({UXDETAIL.ItemDesc}) and
{table.groupfield} = next({table.groupfield})

-LB
 
Hi lbass,

Thanks for the reply, I dont think I have a group. I'm basing the detail line by the ItemDesc field.

I tried:

not onlastrecord and
{UXDETAIL.ItemDesc} = next({UXDETAIL.ItemDesc})

It doesnt work, thanks though.
 
Please show some sample data that illustrates the problem--indicating what field is being omitted that shouldn't be. Is it that you want the Item Desc to appear once per Item No?

Please go to report->group expert and observe whether there are any groups and what they are.

-LB
 
Just add in additional fields:

{UXDETAIL.ItemDesc} = next({UXDETAIL.ItemDesc})
and
{UXDETAIL.someotherfield} = next({UXDETAIL.someotherfield})

Add as many as required to assure uniqueness.

-k
 
Heres the sample data:

Salesperson Multi
Customer PD002
Item Code / Item Description

This is in Detail a > EXPFREGHT00010 FREIGHT EXPENSE
This is in Detail a > EXPFREGHT00010 FREIGHT EXPENSE
This is in Detail a > EXPFREGHT00010 FREIGHT EXPENSE
This is in Detail a > EXPFREGHT00010 FREIGHT EXPENSE
This is in Detail a > EXPFREGHT00010 FREIGHT EXPENSE

Everything gets suppressed because the itemdesc is exactly the same and there is no other itemdesc for the Salesperson Multi group.

In other cases there are more to be compared i.e:

93206X12503004 Ken Kostick Chop. Garlic & Basil - 6x125mg
93206X12503004 Ken Kostick Chop. Garlic & Basil - 6x125mg
93206X12503004 Ken Kostick Chop. Garlic & Basil - 6x125mg
93206X12503005 Ken Kostick Chop. Garlic & Dried Tomatoes
93206X12503005 Ken Kostick Chop. Garlic & Dried Tomatoes
93206X12503005 Ken Kostick Chop. Garlic & Dried Tomatoes


There for the suppression works here leaving that specified group with 2 detail lines:

93206X12503004 Ken Kostick Chop. Garlic & Basil - 6x125mg
93206X12503005 Ken Kostick Chop. Garlic & Dried Tomatoes


Hope this helps.
Thanks.


 
You didn't mention what the groups are other than the salesperson multi group. Is there an additional group on customer? You should use a suppression formula like this if there is a group on customer:

not onlastrecord and
{UXDETAIL.ItemDesc} = next({UXDETAIL.ItemDesc}) and
{table.custID} = next({table.custID})

If your only grou pis on {table.salespersonmulti}, then substitute that field in the formula instead of table.custID.

-LB
 
Thank you lbass it worked when adding the third line of code.

:)
 
First, Not onlastrecord isn't required. On the last record it's no longer applicable and of course would not get suppressed.

Second, how did this solution differ from mine...?

-k
 
Now that i look at it the solution doesnt differ at all, thank you too! *sorries* :)
 
This formula suppresses duplicates but it still would count them, <Insert> <Summary>. If I want to sum the distinct number of ItemDesc returned how do I do that? Insert Distinct count of my formula
If Itemdesc in ["Small","Medium","Large"]
then 1
else 0

is not working...
 
What type formula would I use so that it does not count duplicate Itemdesc? I am using CR 8.5 and SQL. I have a lot of one to many relationships so I get
PersonId ItemDesc Someotherfield
Person1 Small 1
Person1 small 2
Person2 Medium 1
Person3 Medium 1
Person3 Medium 2
Person3 Medium 3
Person3 Large 4
I just want to count 1 small for Person1
1 medium for Person2
1 medium for Person3
1 Large for Person3
 
Use a distinctcount of personID, evaluate using a formula:

{itemdesc} = "Small"

Reset never.

You need separate running totals for each size.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top