Topic Options
#42698 - 08/12/14 10:35 AM Gridview Logical Functions
LanceBakker Offline
Adagio Enthusiast

Registered: 01/10/13
Posts: 25
Loc: Trenton, Ontario
What is the proper way to use multiple IF/OR/AND statements. In this particular case I want to:

Find {Item #} containing "YX" or "ZB" or "TV" and {Amt} * 2%
Everything thing else I want {Amt} * 3.25%

I can get one function working:

IF(
FIND("YX",{Item #},1),
{Amt} * 2%,
{Amt} * 3.25%
)

But I am unsure on how to add the other two.

Thanks,
_________________________
Lance Tennier
TDL Canada

Top
#42699 - 08/12/14 11:02 AM Re: Gridview Logical Functions [Re: LanceBakker]
Warren Karges Online   content


Registered: 08/04/11
Posts: 466
Loc: Waterloo, Ontario
Looks like you want to insert the OR function for the first parameter of the IF statement, for its arguments you'll replicate that find function once per each string you are searching for:
IF(
OR(Find#1, find#2, find#3),
do x,
do y
)
_________________________
Warren
Stief Group

Top
#42701 - 08/12/14 11:51 AM Re: Gridview Logical Functions [Re: Warren Karges]
LanceBakker Offline
Adagio Enthusiast

Registered: 01/10/13
Posts: 25
Loc: Trenton, Ontario
Thanks Warren,

I tried:

IF(
OR(
FIND("YX",{Item #},1),
FIND("ZB",{Item #},1),
FIND("TV",{Item #},1),
)
{Amt} * 2%,
{Amt} * 3.25%
)

I cannot get it to verify. What would be the error?

Thanks,
_________________________
Lance Tennier
TDL Canada

Top
#42702 - 08/12/14 11:53 AM Re: Gridview Logical Functions [Re: LanceBakker]
Softrak Support Offline

Adagio Action Team

Registered: 03/09/99
Posts: 11570
Loc: Vancouver, BC Canada
Remove the comma after the last FIND statement:

IF(
OR(
FIND("YX",{Item #},1),
FIND("ZB",{Item #},1),
FIND("TV",{Item #},1)
)
{Amt} * 2%,
{Amt} * 3.25%
)
_________________________
Regards,
Softrak Tech Support

Top
#42703 - 08/12/14 12:31 PM Re: Gridview Logical Functions [Re: Softrak Support]
LanceBakker Offline
Adagio Enthusiast

Registered: 01/10/13
Posts: 25
Loc: Trenton, Ontario
I hate to be a pain, but I have copied that exact formula into Gridview and I still fail the verification.
_________________________
Lance Tennier
TDL Canada

Top
#42704 - 08/12/14 01:06 PM Re: Gridview Logical Functions [Re: LanceBakker]
Bruce Gardner Online   content
Adagio Wizard

Registered: 06/15/04
Posts: 3617
Loc: Toronto ON, Canada
IF(
OR(
FIND("YX",{Item #},1) > 0,
FIND("ZB",{Item #},1) > 0,
FIND("TV",{Item #},1) > 0
)
{Amt} * 2%,
{Amt} * 3.25%
)
_________________________
Bruce Gardner
ARX Business Solutions Inc.

Top
#42705 - 08/12/14 02:07 PM Re: Gridview Logical Functions [Re: Bruce Gardner]
Warren Karges Online   content


Registered: 08/04/11
Posts: 466
Loc: Waterloo, Ontario
Lance,
I think the issue is that all of the if statements posted after my initial reply are lacking the comma to separate out the OR function as the #1 parameter of the IF statement. You had the correct number of commas the first time, just not in the right place:
If (
Or (find(xxxx)) ,
do x,
do y
)

I haven't used the find function in a little bit but Bruce's suggestion of ensuring the find functions are returning a value >0 is worth considering. The if statement might recognize the returned 0 as false and go to the final part without that, but I'm not sure.
_________________________
Warren
Stief Group

Top
#42706 - 08/12/14 08:08 PM Re: Gridview Logical Functions [Re: Warren Karges]
Bruce Gardner Online   content
Adagio Wizard

Registered: 06/15/04
Posts: 3617
Loc: Toronto ON, Canada
Yes, Warren is correct (he has younger eyes). smile The comma was missing.

IF(
OR(
FIND("YX",{Item #},1) > 0,
FIND("ZB",{Item #},1) > 0,
FIND("TV",{Item #},1) > 0
),
{Amt} * 2%,
{Amt} * 3.25%
)
_________________________
Bruce Gardner
ARX Business Solutions Inc.

Top
#42707 - 08/13/14 05:52 AM Re: Gridview Logical Functions [Re: Bruce Gardner]
SusanTennier Offline
Adagio Maestro

Registered: 02/22/08
Posts: 1247
Loc: Ontario, Canada
Thanks guys! It's working perfect now. 8-)
_________________________
Susan Tennier
TDL Canada
Trenton, Ontario

Top


Moderator:  Christa_Meissner 
Who's Online
1 registered (1 invisible), 84 Guests and 0 Spiders online.
Key: Admin, Global Mod, Mod
Forum Stats
1865 Members
5 Forums
14482 Topics
70726 Posts

Max Online: 432 @ 01/20/25 10:17 PM
May
Su M Tu W Th F Sa
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31