Author |
Message |
TorLang
Groupie
Joined: 13 Jun 2012
Location: United States
Online Status: Offline
Posts: 50
|
Topic: one to many selection Posted: 06 Jun 2013 at 5:24am |
Issue:
Need to pull patients that only have a Primary Insurance.
Patient-------------Primary Insurance -------------Secondary Insurance -------------Tertiary Insurance
Somehow I need to have the report scan through the insurance table and if it finds a primary insurance, pull the record. If if findsa primary and a Secondary, don't pull the record.
Obviously, it the patient does not have a Secondary, it won't have a tertiary either.
All my data is placed in a group footer (a patient / record pr. line, because I am only summarizing. (Patient total charges, patient total payment etc)
I need to select only on primary insurance in report selection. Pri / Sec / Ter Insurances have rank numbers, so I know what rank number to select on.
I suspect I somehow need to use a variable to do this but unsure as to how I would set this up.
Appreciate any insight.
Edited by TorLang - 06 Jun 2013 at 5:26am
|
IP Logged |
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|
Posted: 06 Jun 2013 at 6:13am |
you would have to use group select in crystal unless you want to write a command or stored procedure to do it.
in crystal pull all the patients and insurances
group on the client
insert a summary as the max value of insurance rank per patient
you an now use the group select as
maximum(rank,patient)=1
be aware that for other summarizations you will need to use variable formulas or running totals to do counts,sums, averages, etc. on the remaining records. Running Totals are created in a pass after the group select occurs.
Edited by DBlank - 06 Jun 2013 at 6:14am
|
IP Logged |
|
TorLang
Groupie
Joined: 13 Jun 2012
Location: United States
Online Status: Offline
Posts: 50
|
Posted: 07 Aug 2013 at 7:08am |
That works, but it looks like the record is still there, just with a blank secondary and tertiary insurance. I don't need to select those records at all (with sec. or tert. insurance)
|
IP Logged |
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|
Posted: 07 Aug 2013 at 10:52am |
did you use a group select or record select?
|
IP Logged |
|
TorLang
Groupie
Joined: 13 Jun 2012
Location: United States
Online Status: Offline
Posts: 50
|
Posted: 08 Aug 2013 at 3:48am |
A group select..
|
IP Logged |
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|
Posted: 08 Aug 2013 at 4:35am |
the recoerds will show up in the group tree but they should not show up in the body of the report.
Can you show some rows of data at the detail level before you apply the filter?
Edited by DBlank - 08 Aug 2013 at 4:36am
|
IP Logged |
|
TorLang
Groupie
Joined: 13 Jun 2012
Location: United States
Online Status: Offline
Posts: 50
|
Posted: 08 Aug 2013 at 5:12am |
Yep, moving my data to the detail line shows one record pr. insurance. If the patient have 3 insurances, I see 3 lines of records.
|
IP Logged |
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|
Posted: 08 Aug 2013 at 5:51am |
is this correct...
In your detail row you have one field that is called something like Rank.
This has a 1, 2 or 3 in it for primary, secondary or tertiary.
if a client only has a primary there is only one row for that client with a Rank of 1.
If they have a secondary insurance they have two rows of data where one row of data has a rank of 1 and another row has a rank of 2?
Or is the set up diffent than that?
|
IP Logged |
|
TorLang
Groupie
Joined: 13 Jun 2012
Location: United States
Online Status: Offline
Posts: 50
|
Posted: 08 Aug 2013 at 5:58am |
Correct. Instead of the rank number, I am using the insurance name. But yes, you are correct. (We're talking records on detail line now)
|
IP Logged |
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|
Posted: 08 Aug 2013 at 6:11am |
what is the exact select statement you are using in the group select?
|
IP Logged |
|
|