Get subset of rows through the slice

For example in a table there are 100 rows. In these, 30 rows belongs to current user, I want to get rows from 6 to 10 only. How can we get these rows?

0 3 155
3 REPLIES 3

To get rows 6 to 10 for the current user in AppSheet, first filter rows by 'UserEmail' using 'USEREMAIL()'. Create a slice. Go to Data > Slices and make a slice named 'UserRows6to10'. Use this expression for the filter condition:

INDEX(
ORDERBY(
FILTER("YourTable", [UserEmail] = USEREMAIL()),
[_ROWNUMBER], TRUE
),
6
) : INDEX(
ORDERBY(
FILTER("YourTable", [UserEmail] = USEREMAIL()),
[_ROWNUMBER], TRUE
),
10
)

Next, create a view for this slice. Go to UX > Views and make a view named 'UserRows6to10View', using the slice as the source. Pick the view type you want, like Table or Deck. This will show rows 6 to 10 for the current user.

Hi, Thanks for the reply. I am getting the following error

The expression is valid but its result type 'Ref' is not one of the expected types: Yes/No

used isnotblank but, filter is not working, slice displaying all results.

 

 

If ur getting the error The expression is valid but its result type 'Ref' is not one of the expected types: Yes/No, it seems there's an issue with the expression used in the slice. The expression might be interpreted as returning a reference type instead of a boolean.

Try adjusting the expression by using a different approach. Instead of using the INDEX function, you can create a virtual column that calculates the row number for each userโ€™s row and then use that in the slice condition.

Add a Virtual Column:

  1. Go to Data > Columns and add a virtual column to your table.
  2. Name it UserRowNumber.
  3. Use this formula to assign a sequential number to each row for the current user:
    COUNT(
    SELECT(
    YourTable[KeyColumn],
    AND(
    [UserEmail] = USEREMAIL(),
    [_ROWNUMBER] <= [_THISROW].[_ROWNUMBER]
    )
    )
    )

Update the Slice Filter Condition:

Use the UserRowNumber in your slice condition to get rows 6 to 10:

AND(
[UserEmail] = USEREMAIL(),
[UserRowNumber] >= 6,
[UserRowNumber] <= 10
)



Top Labels in this Space