Trying to set a security filter 'Orders Table' : where it only shows each users their orders

and(ANY(SELECT(AOD[Salesperson ID], ([Email] = useremail())))=[SalesPerson],[Order Date]>=today()-12)
Above formula works perfect and shows each user all their orders.

However i need it to show their Splitsale too:: So at the end of the day, if the users name pops up in either field as [salesperson] or [splitsale], then i need that user to have access to it.
[Salesperson], [Splitsale] : Both are fields in Orders Table that chooses reps name.

I wrote it several ways but doesnt seem to work. Any ideas

Hi @Rurrea
Have you tried using OR() ?

1 Like

Tried the “or” option but it misreads it

No, you’re misusing it.

1 Like

Or(and(ANY(SELECT(AOD[Salesperson ID], ([Email] = useremail())))=[SalesPerson], and(ANY(SELECT(AOD[Salesperson ID], ([Email] = useremail())))=[Splitsale]),[Order Date]>=today()-12)

Tried something like this but it misreads it and just ends up filtering all orders 12 days back for everyone

What I’m I doing wrong or what would u do? Would love to figure this out tonight

Your logic is wrong, the general syntax should be

AND(
  date comparison ,
  OR(
    [salesperson] comparison ,
    [splitsale] comparison
  )
)
1 Like

And([Order Date]>=today()-12,or(ANY(SELECT(AOD[Salesperson ID], ([Email] = useremail())))=[SalesPerson], ANY(SELECT(AOD[Salesperson ID], ([Email] = useremail())))=[splitsale]))

Solution still didn’t work. Unless I’m doing it wrong

AND(
  ([Order Date] >= (TODAY() - 12)),
  ISNOTBLANK(
    INTERSECT(
      LIST(
        [Salesperson],
        [SplitSale]
      ),
      SELECT(
        AOD[Salesperson ID],
        (USEREMAIL() = [Email])
      )
    )
  )
)
3 Likes

Worked perfectly

1 Like