Composite Statement in Select Expert Alternatives

Hello, all!

I’m looking to filter a particular group within a data set. Here’s where I am in the select expert

{name_full.NAMETYPE} = "a" and
(if {GENERIC.GROUPTAG} in ["A","B","C","D","E","F","G","H","I","J","K","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"] OR
{GENERIC.GROUPTAG} = "L" and
{MEMBERSHIP_FULL.MEMBTYPE} = "IALS" and
{SUBSCRIPTIONLEVEL_FULL.SUBLTYPE} = "life" THEN TRUE)

It works, but not very efficient. What other alternatives are there?


transplant (BOB member since 2015-10-27)

I usually avoid using “If” statements in the Select Expert - they frequently will not be passed to the database for processing, which means that Crystal will pull ALL of the data into memory and filter it there, slowing down the report. So, I would try rewriting what you have as something like this:

{name_full.NAMETYPE} = “a” and
({GENERIC.GROUPTAG} in [“A”,“B”,“C”,“D”,“E”,“F”,“G”,“H”,“I”,“J”,“K”,“M”,“N”,“O”,“P”,“Q”,“R”,“S”,“T”,“U”,“V”,“W”,“X”,“Y”,“Z”] OR
({GENERIC.GROUPTAG} = “L” and
{MEMBERSHIP_FULL.MEMBTYPE} = “IALS” and
{SUBSCRIPTIONLEVEL_FULL.SUBLTYPE} = “life” ))

-Dell


hilfy :us: (BOB member since 2007-04-16)

problem with brackets place your or condition two statements in brackets.

({GENERIC.GROUPTAG} in [“A”,“B”,“C”,“D”,“E”,“F”,“G”,“H”,“I”,“J”,“K”,“M”,“N”,“O”,“P”,“Q”,“R”,“S”,“T”,“U”,“V”,“W”,“X”,“Y”,“Z”] OR
{GENERIC.GROUPTAG} = “L”)

:wave:


surya.g :india: (BOB member since 2009-11-24)