How to separate rows of a table based on unique value on a column

Hi Friends, 

I have below tables 

KEYSTYLEDESCRIPTION
1A1
2A2
3B3
4B4

Could you guys advise me how to separate it with <<Start>> <<End>> expression to below 2 thinner tables ? ( I'm trying to do this for Email Body Template )

STYLE : A

KEYDESCRIPTION
11
22

 

STLYE : B

KEYDESCRIPTION
33
44
Solved Solved
0 7 229
1 ACCEPTED SOLUTION

Assuming the table is called "Styles":


<<Start:

FILTER(
  Styles,
  [_RowNumber]=
  MAX(
    SELECT(
      Styles[_RowNumber],
      [Style]=[_THISROW-1].[Style]
    )
  )
)
>>

Style: <<Style>>

KeyDescription
<<Start:
FILTER(
  Styles,
  [Style]=[_THISROW].[Style]
)
>><<Key>>
<<Description>><<End>>

<<End>>

Please change [_THISROW] with [_THISROW-1] on either expression if it doesn't work, I tend to forget the logit sometimes about it's usage. And I found it unreliable sometimes

View solution in original post

7 REPLIES 7

<<Start:SELECT(TABLENAME[KEY], [STYLE] = "A")>>

I am writing this from my phone, so this may not be an instant home run, however, it should be well towards a starting point.

i would recommend switching out SELECT() for FILTER() once you get moving.

<<Start:FILTER("TABLENAME", ([STYLE] = “A”))>>

Hi Ryan, 


Thanks for reply, 

What if in the case that we have many of different STYLE values ? 

Assuming the table is called "Styles":


<<Start:

FILTER(
  Styles,
  [_RowNumber]=
  MAX(
    SELECT(
      Styles[_RowNumber],
      [Style]=[_THISROW-1].[Style]
    )
  )
)
>>

Style: <<Style>>

KeyDescription
<<Start:
FILTER(
  Styles,
  [Style]=[_THISROW].[Style]
)
>><<Key>>
<<Description>><<End>>

<<End>>

Please change [_THISROW] with [_THISROW-1] on either expression if it doesn't work, I tend to forget the logit sometimes about it's usage. And I found it unreliable sometimes

Hi SkrOYC, 

It works great!  with changing to [_THISROW-1]

References!

Reference my friend; connect the two sub tables to the main one, with reference columns on the sub tables.

When you connect the tables together, AppSheet creates "reverse references" - which basically hold the result of the formula you're trying to build.

  • But it does so with high efficiency,
  • whereas a SELECT() formula (or any port, like FILTER()) is basically brute forcing the answer out of your system.

MultiTech_1-1655214026605.jpeg

(^_^)  

Create a "Styles" table as the parent

https://support.google.com/appsheet/answer/10106510?hl=en

Yeah, but he has just one dataset and wants to separate it on multiple template tables for the purpose of reporting. I'm with you that reference can make this scenario way easier and efficient, but he also would need to have a table with all of the Styles available and execute the bot from there, the parent

Top Labels in this Space