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

filtering the formula

Status
Not open for further replies.

michelin

Technical User
Dec 18, 2011
38
US
Dear All,

I'm having issue with my crystal report. I might just make small fix or very complicated formula, but every help/idea would be really appreciated. Let's say that I have Incident number and comment:

Incident number Comment
1 re-opened
1 a
1 b

2 b
2 c
2 e

3 re-opened
3 a


I need to get out of "re-opened" incidents (I just need to see incident number 2).
What I did: I wrote the formula (if comment like re-opened then 'hide'). Then I suppressed according the incident, so my report looked like:

Incident number Comment Formula
1 re-opened hide
2 b
3 re-opened hide

I believed that if I filtered my formula out I would see just incident number 2. But these are my results:

Incident number Comment Formula
1 a
2 b
3 a

Any idea how to solve my problem?
 
Group by Incident Number. Suppress detail lines and either the group header or group footer, since you just want one line.

Create a formula noting re-opened, something like
Code:
if {comment} = "re-opened"
then 1
else 0
Do a summary total at group level for @NoteReopened. (If you're not already familiar with Crystal's automated totals, see FAQ767-6524.)

Choose Report > Selection Formulas > Group. Select for @NoteReopened total of zero.

PS. It helps to give your Crystal version - 8, 8.5, 9, 10, 11 or whatever. Methods sometimes change between versions, and higher versions have extra options. In this case, it probably makes no difference.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 2008 with SQL and Windows XP [yinyang]
 
Thank you very much for your respond!!

I'm sorry for not mentioning that. I'm working with Crystal report version- 12.

I used your directions but I got the same results :(. I think it just picks the next available comment. I was thinking about changing my linking option thru the tables. Currently my linking options are:
join type- inner
enforce join- not enforced
link type- =
 
Dear Madawc,

I have to apologize. I tried your suggestion couple more times and it WORKED!! Now I'm getting the results I wanted! Thank you!!

Just one more quick question.. If I do the total it also counts the Incidents that I didn't want to see.

Before I saw:
Incident number Comment Formula
1 re-opened hide
2 b
3 re-opened hide
Total Number of Incidents: 3

Now I see (thanks to your suggestions ;) ):
Incident number Comment Formula
2 b
Total Number of Incidents: !!!3!!!

My point is that I also needs to do the average time of these incidents and not correct total counting will have an influence in my results. Do you have any idea how to fix this?

Thank you for all your help!!!

 
I got it- running totals :)..

thank you again for your suggestions!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top