[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Group Selection Question in Crystal Reports

Posted on 2009-04-23
13
Medium Priority
?
331 Views
Last Modified: 2012-05-06
I have a report written in crystal 11 off a sql 2008 server.
In this report, I have a list of patient numbers which has the doctor number that patient saw.
A patient will see the primary doctor and will see a backup doctor.
If I group by the patient number, I will see all the doctor numbers that the patient has seen.

My end result is to create a parameter that the user will use to select the Primary Doctor #, then the data that will show are all the accounts #s that were equal to those of the primary doctor, but have the backup doctors' #.

 
Example of current record selection:
Acct#	Backup DR	Primary Doctor
2617150	TEST0	TEST0 PORTAL
2617150	TEST0	TEST0 PORTAL
3832232	TEST0	TEST0 PORTAL
4268651	TEST0	TEST0 PORTAL
2617150	TEST1	TEST1 PORTAL
4268651	TEST1	TEST1 PORTAL
2617150	TEST2	TEST2 PORTAL
3832232	TEST2	TEST2 PORTAL
 
If I was to select Test0portal as the my primary dr., I would like the following to return:
 
PORTAL, TEST1		
2617150	TEST1	TEST1 PORTAL
4268651	TEST1	TEST1 PORTAL
		
PORTAL, TEST2		
2617150	TEST2	TEST2 PORTAL
3832232	TEST2	TEST2 PORTAL

Open in new window

0
Comment
Question by:metalteck
  • 7
  • 5
13 Comments
 
LVL 26

Expert Comment

by:Kurt Reinhardt
ID: 24216306
I'm a little confused by what you want.  In your code sample you're selecting one primary doctor, but returning 2 others, thereby excluding the primary doctor you selected.  Also, why are you using the group selection  editor, which only filters data that's already been returned from the database?
0
 

Author Comment

by:metalteck
ID: 24216354
I know it sounds confusing. But your right, if I select Test0, I need to get all the records that Test0 has equal to Test1 and Test2, but not include Test0's list.
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 24216436
Try selecting records like this

{PrimaryDoctor} = {?DrParameter} AND
( Not IsNull({SecpndaryDoctor}) AND {SecondaryDoctor} <> {?DrParameter})

mlmcc
0
Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

 

Author Comment

by:metalteck
ID: 24216691
Is this under the record selection or group selection?
0
 

Author Comment

by:metalteck
ID: 24216830
When I place this formula in the record selection, I'm still getting all the records. Nothing has change.
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 24219133
Can you copy the record selection you used and the SQL Crystal generates?

mlmcc
0
 

Author Comment

by:metalteck
ID: 24219304
{FOLLOW_UP.DOCTYPE_ID} in [679, 202] and
{FOLLOW_UP.TYPE} = "3" and
not isnull({FOLLOW_UP.QUEUE}) and
{FOLLOW_UP.QUEUE}<>{?Dr} and
{PHYSICIAN_FILE.PHYSICIAN_NAME} = {?Dr}
0
 

Author Comment

by:metalteck
ID: 24219311
This is the output I recieve. All the accounts for Test0 and not Test 1 or 2




Acct#      Backup      Primary Dr
2617150      TEST0      TEST0 PORTAL
2617150      TEST0      TEST0 PORTAL
2617150            
3832232      TEST0      TEST0 PORTAL
4268651      TEST0      TEST0 PORTAL
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 24219431
What are yiu entering for ?Dr

mlmcc
0
 

Author Comment

by:metalteck
ID: 24219782
For the parameter I'm entering Portal, TEST0.
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 24220541
Then you only get the records where the primary dr is portal, test0, which is what you are getting.

mlmcc
0
 

Author Comment

by:metalteck
ID: 24226696
Thats the problem, If I select Test0 as the parameter value, I don't want to get the records where the doctor names are test 0, I want to get all the doctors that have the same account as test0.

Ex. Test 0 has accounts 2617150, 4268651 3832232. But Test 1 has 2617150 and 4268651, while test2 has 3832232.

So for a result set, when I select test0, I want to get all accounts equal to test0, but not show test0's results.
0
 
LVL 101

Accepted Solution

by:
mlmcc earned 2000 total points
ID: 24226910
Try this idea

Add the table to the report again.
Link them on the ACCOUNT number

Select criteria
{T1.PrimaryDr} = {?DR} and {T2.PrimaryDR} <> {?DR}

mlmcc
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question