duplicated value in grouped field
Printed From: Crystal Reports Book — Forum Name: Technical Questions
Posted By: Indigenous — 29 Nov 2016 at 8:31am
Greetings, I can't seem to get a duplicated value in a grouped field to render correctly (field is to turn red if duplicated).
group1 - location
group2 - invoice#
details - items associated with invoice
Invoice# field font color formula 'if invoice#=previous(invoice#) then red else black'.
This only works if the invoice# is exactly the next record displayed. Any records in between causes the field to remain black.
I'm not trying to suppress any records ... just change color on condition.
Any thoughts?
Thanks, Ian
Posted By: DBlank — 29 Nov 2016 at 9:13am
sample data?
Posted By: kevlray — 29 Nov 2016 at 11:50am
A bit confused. If you are grouping by Invoice number, then all records in that group should have the same invoice number?!?
Posted By: Indigenous — 30 Nov 2016 at 7:41am
data sample--
location A [group1]
invoice 1 [group2]
invoice 2 [group2]
location B [group1]
invoice 1 [gpoup2] - (same value as found in location A but doesn't respond to invoice#=previous(invoice#) formula to set a condition)
And correct, a particular invoice# only shows up once under each location.
The goal is to have any invoice# change color if it shows up more than once anywhere in the report.
I don't understand why this is happening. It seems like other reports work fine with a similar setup. Might I have a wrong setting somewhere .. or does this seem like it needs a more involved formula...
Posted By: DBlank — 30 Nov 2016 at 10:22am
Ahhh
Your location group is splitting up the invoice.
That is why previous/next wont work as it is the order in which it is displayed in the report, not the source table.
That is a bit tricky. There are not likely any good ways to do this with creating another data point to use.
Do you have rights to creating a stored procedure or a crystal command?
If so you can create a count of the invoices and then join that to the data set and use the count value to conditionally set your font color.
Posted By: Indigenous — 1 Dec 2016 at 6:48am
Yeah, no way to have access for a stored procedure.
I think the quick answer will be to run a second report just for dups.
Thank you all for your efforts.
|