Gridview formula

Posted by: SusanTennier

Gridview formula - 09/30/09 11:28 AM

Can 2 OR commands be used in a filter? I'm trying to do this but it's not working. Can anyone help?

AND(
OR(
{Terms} = " CODCC",
{Terms} = " NETCC",
)
OR(
{Item #} = "SAEX3150TDL",
{Item #} = "SAEX4100",
{Item #} = "SAEX4120",
{Item #} = "SAEX5900RB",
{Item #} = "SAEX6131R",
{Item #} = "SAEX9200TDL",
{Item #} = "SAEX9241R",
{Item #} = "SAEX9242R",
{Item #} = "SAEX64362",
{Item #} = "SAEX643621",
{Item #} = "SAEX64364",
{Item #} = "SAEX643641"
))
Posted by: Softrak Support

Re: Gridview formula - 09/30/09 11:38 AM

Hi Susan,

It should be allowed. Whether it is working as expected is another thing.

I assume that you want to select any of the items from the list where the invoice has either of the two terms. Is that correct?

You need a comma between the 2 OR portions, to make the AND part correct. You also need to remove the comma after the second terms code. If you want to indent the OR parts to improve readability, that may be interesting.
Code:
AND(
  OR(
  {Terms} = " CODCC",
  {Terms} = " NETCC"
  )
,
  OR(
  {Item #} = "SAEX3150TDL",
  {Item #} = "SAEX4100",
  {Item #} = "SAEX4120",
  {Item #} = "SAEX5900RB",
  {Item #} = "SAEX6131R",
  {Item #} = "SAEX9200TDL",
  {Item #} = "SAEX9241R",
  {Item #} = "SAEX9242R",
  {Item #} = "SAEX64362",
  {Item #} = "SAEX643621",
  {Item #} = "SAEX64364",
  {Item #} = "SAEX643641"
  )
)

If the list of Terms codes and/or Item codes could be different than the lists above, you would be better off creating two new views (one for the terms code list and the other for the item code master list) and link them both to your view. Then Join the links together, meaning you can multi-select from the Terms and Items lists and select the combinations just like your filter formula.
Posted by: SusanTennier

Re: Gridview formula - 09/30/09 11:42 AM

Thanks for the speedy reply. It works great!