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

including and excluding values from a field based on another field. 1

Status
Not open for further replies.

Shannon2008

Technical User
May 28, 2008
17
CA
Hi,
I am trying to exclude certain values from a field in order to determine a tax rate. The rate would be based on Province PRTIME.WC_STATE

i.e. I would like to exclude code BLC from PAYDEDUCTN.DED_CODE if EE works in BC. Also, I would like to include certain values from a different field PRTIME.PAY_SUM_GRP based on province. Please help.
 
Please try again without the lingo--we don't know what EE and BC are, and please show some sample data.

-LB
 
Sorry, I am new at this.

EE=employee and BC=British Columbia

SAMPLE DATA
If EE works in BC, then do not include deduction code 'B' in calcuation - and if EE works in BC then include earnings codes 'A','B','C' in calculation, else if EE works in AB (Alberta) then include deduction code 'B' in calcuation - and if EE works in AB include earnings codes 'A','B','C','D'
and so on for all provinces.

Hope this is better.
Thanks.
 
And your sample data? Please show some sample rows of data, identifying field names.

-LB

 
EE# PROV E_CODE E_AMT D_CODE D_AMT TOTAL PREM
149 AB A 375.16 B .64 375.80 2.51
149 AB B 200.00 B .58 200.58 1.34
148 BC C 310.00 B .61 310.00 1.76
148 BC D 150.00 B .53 0.00 0.00

Where PROV = BC do not include D_CODE B and Where PROV=AB include D_CODE B
Where PROV = BC do not include E_CODE D and Where PROV=AB include E_CODE D

Hope this is enough info.
Thanks.
 
//{@Total}:

if {table.prov} = "BC" then
(
(
if {table.d_code} <> "B" then
{table.d_amt}
) +
(
if {table.E_code} <> "D" then
{table.E_amt}
)
) else
if {table.prov} = "AB" then
(
(
if {table.d_code} = "B" then
{table.d_amt}
) +
(
if {table.E_code} = "D" then
{table.E_amt}
)
)

-LB

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top