Failed Slice Filtering

Hello!

I currently have the following Slice constructed:

OR([_THISROW] = ANY(TOP(FILTER(BRADYcore@HOME,AND(ISNOTBLANK([Category]),([Category] = "ARMS"))),1)), [_THISROW] = ANY(TOP(FILTER(BRADYcore@HOME,AND(ISNOTBLANK([Category]),([Category] = "BACK"))),1)))

And, when I click the “Test” button for the expression, it produces one item of Category ARMS and one item of Category BACK.

But, when I use it as the dataset for a View, the View displays all items in the dataset, as if I hadn’t done anything.

The goal is to produce one random value of Category ARMS and one random value of Category BACK, and have that display in a particular View (using this Slice).

Please help! I’m trying to learn AppSheet but there is a learning curve, compared to my non-AppSheet SQL experience.

Thanks!

Kyle

Solved Solved
0 2 125
1 ACCEPTED SOLUTION

Steve
Platinum 4
Platinum 4

Your expression reformatted to my liking for clarity:

OR(
  [_THISROW]
  = ANY(
    TOP(
      FILTER(
        BRADYcore@HOME,
        AND(
          ISNOTBLANK([Category]),
          ([Category] = "ARMS")
        )
      ),
      1
    )
  ),
  [_THISROW]
  = ANY(
    TOP(
      FILTER(
        BRADYcore@HOME,
        AND(
          ISNOTBLANK([Category]),
          ([Category] = "BACK")
        )
      ),
      1
    )
  )
)

The table name, BRADYcore@HOME, contains the @ character, which has the potential to cause problems when the table name is not enclosed in square brackets or double-quotes. In this context, double-quoting the table name is recommended: "BRADYcore@HOME".

Kudos on your use of ISNOTBLANK() before testing textual equality!

The use of ANY(TOP(..., 1)) is redundant; ANY(...) is sufficient here.

View solution in original post

2 REPLIES 2

Steve
Platinum 4
Platinum 4

Your expression reformatted to my liking for clarity:

OR(
  [_THISROW]
  = ANY(
    TOP(
      FILTER(
        BRADYcore@HOME,
        AND(
          ISNOTBLANK([Category]),
          ([Category] = "ARMS")
        )
      ),
      1
    )
  ),
  [_THISROW]
  = ANY(
    TOP(
      FILTER(
        BRADYcore@HOME,
        AND(
          ISNOTBLANK([Category]),
          ([Category] = "BACK")
        )
      ),
      1
    )
  )
)

The table name, BRADYcore@HOME, contains the @ character, which has the potential to cause problems when the table name is not enclosed in square brackets or double-quotes. In this context, double-quoting the table name is recommended: "BRADYcore@HOME".

Kudos on your use of ISNOTBLANK() before testing textual equality!

The use of ANY(TOP(..., 1)) is redundant; ANY(...) is sufficient here.

Thank you!

Top Labels in this Space