For my app, which tracks walks that people have taken shelter dogs on, I want to show a list of dogs sorted by the last walk date.
I have a dog table which has columns about the dog that are dynamic, and a walks table which is dynamically created when a new walk (activity) is performed. I can see a list of walks for each animal on the detail page, I just need to get the latest entry from that list.
There is a MAX() function you can use to get the highest value in a list of values. Simply apply it to the list of Dates for each dog - which it looks like you have already. If not and you need help, just post back here.
To color the date based time passed, you would want to use a Format Rule.
Yes, it looks like I have identified the most recent walk row for each dog, (true/false) but I want to have this show up on the dog deck view automatically under their name. That is the part I canāt figure out.
Iād guess the date is the row label, and that the list of dates in the deck view comes from the system-generated column with an App formula expression that uses REF_ROWS(), probably having a name beginning with āRelatedā.
The order of the rows in the inline table in the details view is determined by the configuration of the table view with a name probably ending with ā_Inlineā in the ref position for the (data) table containing those rows.
The order of the dates in the deck view, presumably coming from the REF_ROWS() column mentioned above, is undefined: theyāre in no intentional order, they just happen to be in (what appears to be) chronological order, earliest to latest. It sounds like you either want them sorted in reverse chronological order (latest to earliest), or you just want the latest.
To order the dates in the deck view in reverse chronological order, edit the current REF_ROWS() expression to wrap it with ORDERBY(). For instance, if itās currently this:
Note that Walks and Dog Id should be replaced with whatever values are already in the current REF_ROWS() expression, and Walk Date should be replaced with the name of the column in your walks table that contains the date of the walk.
Hi Steve, I thought that my sheet was identifying which date was the most recent for each dog with a maxrow formula but it was just finding the latest walk overall.
Here is my data sheet:
What I want to do is to group the āWalksā tab rows by dog āNameā, and show only the most recent walk for that dog on a deck, table or card view.
I have been able to display dates but not specific to the dog, just all the same date.
Hi @tloder
I think you need to use MAX as @WillowMobileSystems has suggested. I dont know what your tables and column names are but maybe create a vitual column [Max walk date] with something like
MAX(SELECT(dogtable[Walkdate],[dog]=[_THISROW].[dogname]
You can then create a deck view with Dog and max walk date.