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!

Conditional suppress

Status
Not open for further replies.

veles

Technical User
Sep 1, 2006
57
CA
Hi ,
I am using crystal XI. I created a report that has clients with addresses

G1 is the Client#
G2 is the client address type (physical location or mailing address)

Some clients can have both mailing and physical address, some only physical.

I am trying to create a formula that will display
if the client has both to display the mailing else the pysical.

Any help is appreciated.
 
i am thinking this through as i type, and, as usual, i do not have crystal in front of me, so my apologies if i misunderstood the need &/or have typos or errors.

I would create a formula that evaluates if the address is physical or mailing:
{@addrcheck}
IF {Table.AddrType} = "Physical" then 0 else 1;

Then use a something like this in the suppression logic.
{@addrcheck} = 0
 
I tried that approach but it suppresses the whole client, nut just the group with the physical address if the client has both addresses.
I need it to suppress only the physical address and still show the mailing
 
Sort so that the mailing address always come after the physical address if both are present.
Put everything in the G1 footer.
 
Hi veles

Add the following Group Selection to the report:

Code:
(
    DistinctCount({table.ADDR_TYPE}, {table.CLIENT}) = 1 and
    {table.ADDR_TYPE} = 'Physical'
)
or
(
    DistinctCount({table.ADDR_TYPE}, {table.CLIENT}) > 1 and
    {table.ADDR_TYPE} = 'Mail'
)

Cheers
Pete
 
Alternatively, DO NOT group by Address type

Remove adress type group and sort so that mail address will appear first

Place address details in Details

Create a Running Total #AddressCount

Set it to count Client ID, evaluate every record, reset on change of client ID group

In details section expert, in suppression formula

{#AddressCount} >1

Ian
 
Thanks all,

Ian, your solution worked for me.
Thank you
 
Or you could not group on address type and use a formula like this:

if isnull({table.mailingaddress}) then
{table.physcialaddress} else
{table.mailingaddress}

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top