Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Formula in Select Expert Or Something Else? Post Reply Post New Topic
Author Message
rspeters
Newbie
Newbie


Joined: 13 Sep 2011
Location: United States
Online Status: Offline
Posts: 4
Quote rspeters Replybullet Topic: Formula in Select Expert Or Something Else?
     Posted: 13 Sep 2011 at 6:10am

Newbie Here.  I’m having an issue with a select expert formula that I’m wondering if you can help me on.  I’m using Crystal 11 to pull reports from a ticketing system (HEAT).  In a given ticket there can be a number of assignments which are in the Asgnmnt table.  An assignment consists of a group and then individual assignees under that group.  In a ticket there may be a total of 3 assignments, all that have different groups and obviously different assignees. 

 

The report I’m working on is grouped by ticket number and then assignment.  I’m trying to setup the select expert so it only gives me tickets that have at least one assignment to “USSC CCA II Review” in them, of those tickets I want it to also give me the assignments that are under a different group name called “US REG SRS”.  I’m thinking it’s some sort of If Then statement I need to use in the select expert but I’ve made several attempts at and just not having much luck.  To restate what I want my end result to be, I want the report to only give me tickets that have a “USSC CCA II Review” assignment in them, and then I want to see all of the “USSC CCA II Review” assignments, and the assignments that have the group name of “US REG SRS”.

 

 

Any thoughts on how I would do this?  I was thinking I could put an IF THEN statement in Select expert like below, and it gives me the right tickets, but doesn’t let me see the assignments that are under the groupname US REG SRS (the assignment “USSC CCA II Review” isn’t under the groupname “US REG SRS”).

 

If {Asgnmnt.groupname} = "US REG SRS"

  Then  {Asgnmnt.Assignee} in "USSC CCA II Review"

          Else {Asgnmnt.Assignee} = "USSC CCA II Review"

 

To be honest, I wouldn't be surprised if I'm going about it all wrong, and I don't even need to get this setup in the select expert like I'm trying to do.  Thanks in advance for any help you can provide me.

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 13 Sep 2011 at 7:32am
Can't quite follow your overall set up...
can you post a little sample data and what youwant to keep and what you want to discard with why?
In general though IMO stay away from using if then in any record selection criteria,
and you can do group selection ccriteria on summarized group data so you can flag rows with something like
if {Asgnmnt.Assignee} in "USSC CCA II Review" then 1
then sum this at your group level and it will tel if you the group
that sum can then be used to include or exclude the whole group using the select expert group selection
example:
SUM(@flag,group)>0
IP IP Logged
rspeters
Newbie
Newbie


Joined: 13 Sep 2011
Location: United States
Online Status: Offline
Posts: 4
Quote rspeters Replybullet Posted: 13 Sep 2011 at 8:49am

Thanks so much for your help...sorry I didn't do a better job explaining my setup.  I’m not sure if this is what you’re looking for, but let’s say we have three tickets down below.  I want to only pull the tickets that have a “USSC CCA II Review” assignment in them.  Also, for those tickets that have that assignment (USSC CCA II Review)if they have any assignments in them with the group name of US REG SRS, I want to be able to pull those assignments as well.  So for the below examples, I would want to pull tickets 12345 and 67890 and see assignments 1 and 2 on the first ticket, and the assignment on the second ticket as well.  I wouldn’t want the report to pull the third ticket at all. 

 

1.       Ticket 12345

                                                                Group Name         Assignee Name

Assignment 1:                       USSC                       USSC CCA II Review

Assignment 2:                       US REG SRS            John Doe              

                Assignment 3:                       etc                          Jane Doe               

 

2.       Ticket 67890

Group Name         Assignee Name

Assignment 1:                       USSC                       USSC CCA II Review

 

 

3.       Ticket 99999

                               

Group Name         Assignee Name

Assignment 1:                       US REG SRS            John Doe              

                Assignment 2:                       etc                          Jane Doe               

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 13 Sep 2011 at 10:39am
maybe...
group on ticket
crate a formula to flag your tickets that have USSC CCA II Review
if {Asgnmnt.Assignee} in "USSC CCA II Review" then 1
Create a sum summary of the flag formula at the ticket group level
SUM(@flag,table.ticket)
in the select expert switch the option to group selection and add your criteria here
SUM(@flag,table.ticket) >0
this will only leave tickets that have at least one ussc caa record in them.
in the section expert select detail section and conditionally supress on
table.groupname<>"US REG SRS" or table.assignee <> "USSC CCA II Review"
IP IP Logged
rspeters
Newbie
Newbie


Joined: 13 Sep 2011
Location: United States
Online Status: Offline
Posts: 4
Quote rspeters Replybullet Posted: 13 Sep 2011 at 10:57am
Awesome.  I'm trying it right now I'll let you know how it goes...thanks again!
IP IP Logged
rspeters
Newbie
Newbie


Joined: 13 Sep 2011
Location: United States
Online Status: Offline
Posts: 4
Quote rspeters Replybullet Posted: 14 Sep 2011 at 4:47am
It worked!!!  The only thing I had to do was change the "or" to an "and" in the suppression formula below...not sure why that made the difference, but it's all working now.  Thanks again!
 
"table.groupname<>"US REG SRS" or table.assignee <> "USSC CCA II Review""
IP IP Logged
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