Creating a slice of a slice

Hello!

I am trying to create a slice of data that will show only entries from the last 3 months that contains a matching value in a key column. I would like to also add the condition that there are no other entries in the most recent three months that match an anti-matching value in that same column:

example:

Date: 1 year ago, crop: apple, matching_col: [matching value] -> NO

Date: 2 months ago, crop: apple, matching_col: [matching value] -> YES

Date: 2 months ago, crop: pear, matching_col: [anti_matching value] -> NO

Date: 2 months ago, crop: pear, matching_col: [matching value] -> NO (because there exists an entry somewhere else in the table that matches on the anti match.

My first thought to implement would be to:

1. Create a slice of the most recent three months (called recent)

2. Create a slice based on the recent slice of the anti matches (called anti)

3. Create a slice based on the recent slice and filter out anything found in the anti slice

However I am unable to see these slices when I try to create a new slice. Is there a way I would be able to refer to existing slices when creating new slices? 

Also - I do feel that this is not the best implementation, but I have been struggling with automations and bots as well. Let me know if you all have any clever implementation ideas.

 

Solved Solved
0 4 1,096
1 ACCEPTED SOLUTION

Right--you can only select a table (i.e., not a slice) for a slice's Source Table property. @Aurelien's guidance is on point for the scenario described.

FYI, in case it's ever helpful, it's also possible to base one slice on another using the IN function. That may be appropriate when it's necessary to maintain both slices for other reasons--and, depending on the complexity of the parent slice's row filter condition, conceivably provides performance benefits by not repeating that complexity in the child slice.

Here's a conceptual example of a row filter condition for SliceB based on SliceA:

AND(
IN([ID], SliceA[ID]),
[Criterion 3],
[Criterion 4]
)

 

View solution in original post

4 REPLIES 4

Aurelien
Google Developer Expert
Google Developer Expert

Hi @monamohebbi 

You should have posted this question in the Q&A category, not Tips & Tricks. I notified the moderation team to move it to the right category ๐Ÿ™‚

About your question: you can't. One slice for each condition criteria.

You should combine AND() and OR() expression to create each slice.

For reference:

AND() - AppSheet Help

OR() - AppSheet Help

Slices: The Essentials - AppSheet Help

Yes/No expressions - AppSheet Help

 

Right--you can only select a table (i.e., not a slice) for a slice's Source Table property. @Aurelien's guidance is on point for the scenario described.

FYI, in case it's ever helpful, it's also possible to base one slice on another using the IN function. That may be appropriate when it's necessary to maintain both slices for other reasons--and, depending on the complexity of the parent slice's row filter condition, conceivably provides performance benefits by not repeating that complexity in the child slice.

Here's a conceptual example of a row filter condition for SliceB based on SliceA:

AND(
IN([ID], SliceA[ID]),
[Criterion 3],
[Criterion 4]
)

 

This sounds great! I was hoping for performance improvements by only looking through the most recent data for the slice.  Where would I find the ID for my slice?

In my example, [ID] is only an illustrative column name. Use instead the key column of your own table.

Top Labels in this Space