Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: formula help Post Reply Post New Topic
Author Message
sanchezgmc06
Senior Member
Senior Member
Avatar

Joined: 21 Jan 2011
Online Status: Offline
Posts: 107
Quote sanchezgmc06 Replybullet Topic: formula help
     Posted: 15 Feb 2013 at 1:41pm
hello i am trying to build a formula that will categorize client under the following categories. After i put them in categories i want to use the select expert to only select the no coverage records.  
 
medical
medicare
healthy families
no coverage
other
 
This is the formula I am using:
 
{billing_guar_order_cur_ep.guarantor_order_number}= '1' and
{billing_guar_order_cur_ep.GUARANTOR_ID} = '10' then 'medi-cal'
else if {billing_guar_order_cur_ep.GUARANTOR_ID} = '2' then 'medicare'
else if {billing_guar_order_cur_ep.GUARANTOR_ID} = '12' then 'Healthy Family'
else if {billing_guar_order_cur_ep.GUARANTOR_ID}  in ['1','3','99'] then 'No Coverage'
else 'other'
 
The problem with this is that we have about 4 fields where we enter the guarantor.ID this is why in the beginning of the formula I said {billing_guar_order_cur_ep.guarantor_order_number}= '1' and so i only want to categorize the information entered in  field 1.
 
if i drag my formula to my report it works however when i select through the select expert "no coverage" it brings back any clients whom have a guarantor in any of the additional 3 fields that are guarantor ID 1,3,99.
 
so if the client has guarantor order 1 as guarantor 2
but also has guarantor order 2 as guarantor 1 and i select only records with no coverage it will bring up this client because he/she has guarantor 1 (which is one of the no coverage codes) in another one of the 4 fields available.
 
 
Its hard to explain. Please let me know if i dont make any sence
 
thank you
 
 
 
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 18 Feb 2013 at 6:31am
If you do the select based on a formula like this, Crystal will have to pull ALL of the data into memory and then filter it there.  This is very inefficient and can significantly slow the report down.  If you just want the "No Coverage" records, I would edit the record selection formula and do something like this:
 
{billing_guar_order_cur_ep.guarantor_order_number}= '1' and
{billing_guar_order_cur_ep.GUARANTOR_ID} in ['1','3','99']
 
-Dell
IP IP Logged
sanchezgmc06
Senior Member
Senior Member
Avatar

Joined: 21 Jan 2011
Online Status: Offline
Posts: 107
Quote sanchezgmc06 Replybullet Posted: 05 Mar 2013 at 12:11pm

This was the solution:

Formula (medical):
IF{billing_guar_order_current.GUARANTOR_ID}= '10'
THEN 'Medi-cal'
ELSE
IF {billing_guar_order_current.GUARANTOR_ID}= '12'
THEN 'Healthy Family'
ELSE
IF {billing_guar_order_current.GUARANTOR_ID} IN ['1','3','99']
THEN 'No Coverage'
ELSE 'Other'
 
I added the following to my select expert:
{@medical} = "No Coverage" and
({billing_guar_order_current.GUARANTOR_ID}= '10'
or
{billing_guar_order_current.GUARANTOR_ID}= '12'
or
{billing_guar_order_current.GUARANTOR_ID}= '1'
or
{billing_guar_order_current.GUARANTOR_ID}= '3'
or
{billing_guar_order_current.GUARANTOR_ID}= '99')
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