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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

new 2 evaluate tickets and don't count dupicate ones twice.

Status
Not open for further replies.

kwr04

Programmer
Jan 15, 2010
11
0
0
US
crystal report
---------------------------------------------------------
group header#1 assign_support groups
abc & xyz
----------------------------------------------------------Group header#2 Items
formula called "Rest-Low-ST" place in group header#2
Shared Numbervar low_count := 0
low_count
---------------------------------------------------------- Details section Suppress
formula called "Count-low-st" place in detail section
Shared Numbervar low_count;
If (({Priority} = "Low" and {ticket_number} <> next(ticket_number}) and previous({ticket_number}) <>
next (ticket_number}))) Then low_count := low_count +1

-----------------------------------------------------------Group footer#2 formula called "Count-Low-Item" place in footer#2
Shared NumberVar low_count;
low_count
-----------------------------------------------------------
Group foooter#2 output

Items Urgent High Medium Low
Application 0 o o
wxyz 1 0 1 1
0 1 2 1
First record for Low is true and should display 1 but does not get evaluated. If anyone has any suggestion it would be appreciated
 
You're writing your own variables instead of letting Crystal do it for you. (You also don't need Shared Variable except when passing back data from a subreport.)

The Distinct Count option should get what you want. Start fresh, right-click on the field and let the software do most of the work.

The use of Crystal's automated totals is outlined at FAQ767-6524.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 10 & 11.5 with Windows XP [yinyang]
 
The issue here is that on the first record in your dataset, there is no previous value. The same is true on your last record--there is no next value. When you are evaluating these records, they will be null. I'm not sure what you would want to happen on these records (count or not), but you should build in something like:

whileprintingrecords;
shared numbervar low_count;
If {Priority} = "Low" and
(
(
onlastrecord or
{ticket_number} <> next(ticket_number})
) and
(
onfirstrecord or
onlastrecord or
previous({ticket_number}) <> next (ticket_number})
) then
low_count := low_count +1;

But you should also be building in clauses to rule out comparisons with previous and next group instances, so that you don't get invalid comparisons.

-LB
 
LB Thank you
You got me on the right track here is my formula solution.

whileprintingrecords;
shared numbervar high_count2;
If ({ESI_esi_audit_hpd_hpd_helpdesk_JOIN.Priority}) = "High" and
Onfirstrecord or OnLastrecord
Then high_count2 := high_count2 +1
Else If ({ESI_esi_audit_hpd_hpd_helpdesk_JOIN.Priority} = "High" and
{ESI_esi_audit_hpd_hpd_helpdesk_JOIN.ticket_number} <>
next({ESI_esi_audit_hpd_hpd_helpdesk_JOIN.ticket_number})
and
previous({ESI_esi_audit_hpd_hpd_helpdesk_JOIN.ticket_number}) <>
next({ESI_esi_audit_hpd_hpd_helpdesk_JOIN.ticket_number}))
Then high_count2 := high_count2 +1
 
actual I had to add one more item here is what works.

whileprintingrecords;
shared numbervar low_count2;
If ({ESI_esi_audit_hpd_hpd_helpdesk_JOIN.Priority}) = "Low" and
Onfirstrecord or ({ESI_esi_audit_hpd_hpd_helpdesk_JOIN.Priority}) = "Low" and
OnLastrecord
Then low_count2 := low_count2 +1
Else If ({ESI_esi_audit_hpd_hpd_helpdesk_JOIN.Priority} = "Low" and
{ESI_esi_audit_hpd_hpd_helpdesk_JOIN.ticket_number} <>
next({ESI_esi_audit_hpd_hpd_helpdesk_JOIN.ticket_number})
and
previous({ESI_esi_audit_hpd_hpd_helpdesk_JOIN.ticket_number}) <>
next({ESI_esi_audit_hpd_hpd_helpdesk_JOIN.ticket_number}))
Then low_count2 := low_count2 +1
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top