Any ideas to improve performance of MINROW or MAXROW type of expressions

I have an app where a users work activity, in different data tables, is captured and collated into a single data structure made up of Work Summary and Work Details.  Work Summary calculates the Total spent time across various activities while Work Details shows a line-by-line view of each activity contributing to the Summary.  

Entries are not forced in a chronological order so a user can enter things in any order or adjust Start/End times as needed - on any day at any time.  Some of the Summary items rely on the earliest timestamps or latest timestamps so I am using MINROW() and MAXROW() expressions to find these rows that are then used to grab details from for the other calculations OR displayed items.  

However, for the various Work Summary calculations, I really only need to look at the entries for THAT work day which are listed in the [Related Work Details] column under each Work Summary row.

What I am wondering is if there is some ingenious way to run a MINROW()/MAXROW() expression (or other expression that achieves similar results) against only the [Related Work Details] list of rows??

0 2 63
2 REPLIES 2

You can by deconstructing the wrapper function and re-writing it against the [Related...] column instead of the whole table.

MAXROW( table , col , cond ) is a wrapper for:

ANY(SELECT( table[key-col] , [col] = MAX( SELECT( table[col] , cond ) ) ) )

So re-write that to:

ANY(SELECT( [Related...][key-col] , [col] = MAX( SELECT( [Related...][col] , cond ) ) ) )


@Marc_Dillon wrote:

ANY(SELECT( [Related...][key-col] , [col] = MAX( SELECT( [Related...][col] , cond ) ) ) )


Ah.  I tried this but I think I forgot the [key_col] part.  Thanks!

 

Top Labels in this Space