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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Specified code falling outside grouping formula error

Status
Not open for further replies.

IceRuby

Technical User
Jan 20, 2004
85
AU
Using Crystal XI - ODBC connection to SQL 2000 database.

I am using the below formula to provide data grouping. Via Group Expert I have selected specified order, nominated appropriate order and flagged any other items remain within their own groups.

Code "LCTACD" should fall under my formula specified group "OTHER" however it is falling outside all my formula grouping, being captured within Crystal's non specified grouping. Is it because it is already being qualified within "Salaries & Wages" group and how can I fix?

Thanks in advance.

Grouping formula...
if {transaction_type} = "WORK" and not({time_code} in ["WC", "WC85", "MIL", "ABS", "ANNACC", "ANNCRA", "ANNDRA", "LCTACC", "LCTACD", "LCTCRA", "LCTDRA", "LSLACC", "LSLCRA", "LSLDRA", "LWOP", "MILU", "PLU", "WC80"]) then "SALARIES & WAGES" else

if {transaction_type} = "WORK" and {time_code} in ["WC", "WC85", "MIL", "ABS", "LWOP", "MILU", "PLU", "WC80"] or {allow_dedn_code} = "OSTAXP"
then "EXEMPT TRAN" else

if {transaction_type} = "ALLOWANCE" and not({allow_dedn_code} in ["EGPLSD", "MILADJ", "PILOND", "VRLSD", "WCADJ", "ROLOVR"])
then "BONUSES & ALLOWANCES" else

if {transaction_type} = "DEDUCTION" and {deduction_category} = "NON EMPLOYEE" and {paye_tax_category} <> "GROSS" and not({allow_dedn_code} in ["RBFER2", "RBFER3"]) or {t510_payroll_transaction.t510f070_allow_dedn_code} like "*ER4" then "EMPLOYER SGC" else

if {transaction_type} = "DEDUCTION" and {paye_tax_category} = "GROSS" and not({allow_dedn_code} in ["RBFER2", "RBFER3", "EPAC2", "REM2", "PUCHLV"]) and not({t510_payroll_transaction.t510f070_allow_dedn_code} like "*EE1" or {allow_dedn_code} like "*EE2") then "SALARY SACRIFICE" else

if {allow_dedn_code} like "*EE1" or {allow_dedn_code} like "*EE2" or ({allow_dedn_code} in ["EPAC2", "REM2"]) then "Super Sal Sac" else

if {time_code} = "LCTACD" or {deduction_category} = "DISBURSEMENT" and not({allow_dedn_code} in ["RBFER2", "RBFER3"]) or {deduction_category} in ["NET PAY", "TAX"] or {allow_dedn_code} = "PUCHLV"
then "OTHER"
 
Hard to say here, but one problem you may be encountering is your use of OR.

Adjust parentheticals to fully qualify your requirements:

if
(
{time_code} = "LCTACD"
)
or
(
{deduction_category} = "DISBURSEMENT"
and
not({allow_dedn_code} in ["RBFER2", "RBFER3"])
)
or
(
{deduction_category} in ["NET PAY", "TAX"]
)
or
(
{allow_dedn_code} = "PUCHLV"
)
then
"OTHER"

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top