Unique list of dates from one table into another

Hi,

I am very new to app sheet and looking for some help. 

I have a table of data which includes a date column and a station column. There are multiple entries for each date.

I want to have another table which displays a unqiue record of the date and station so that I can do some counting functions on the data based on other data in the table.

In google sheets I would just do this with the formula:

=sort(unique(filter('Table A'!B2:C,'Table A'!B2:C<>"")))

When I use this spreadsheet formula I get the data I want in Table B but I'm not able to do the counting that I want from Table A from it.

Any help is appreciated. Thanks

0 1 18
1 REPLY 1

Hello there,

You need to create a slice which will filter any duplicates, but for that, you need a way to know which rows are the duplicates.

For that, I suggest you add a new column to your table with an initial value expression like this:

 

COUNT(
 SELECT(
  Table A[id],
  AND(
   [dateColumn]=[_THISROW].[dateColumn],
   [stationColumn]=[_THISROW].[stationColumn]
  )
 )
)

 

This expression will generate a number for each row added, the first one added for a given day and station will be 1, then 2, and so on.

You can now create a slice for this table, and the filter condition will be [newColumn]=1

Now you'll have a slice with only your desired rows, and you'll be able to use it on any expressions that you want on appsheet in order to get your counting done. 

The data that is already there won't be numbered of course, but you can number those using a similar expression within google sheets, and let AppSheet populate the numbering on the new ones.

Top Labels in this Space