Hi, I have an app for supply chain that I use to calculate the delivery dates and inform my customers if it changes.
I have a table with packings: APP_PACKINGS
I have a table with delays: APP_PACKINGS_DELAY
As I can have multiple delays for one packing, I must check the last modified delay (all the rows have a message in case people want to check why there is the problem). I tried 2 ways to do it:
1st Option:
LOOKUP(MAX(SELECT(app_packings_delay[date_add],
[_THISROW].[as_id_packing] = [as_id_packing])),
app_packings_delay,
date_add,
delay
)
2nd Option:
LOOKUP(MAXROW("app_packings_delay","date_add",
([_THISROW].[as_id_packing] = [as_id_packing])),
app_packings_delay,
as_id_packing_delay,
delay
)
Thanks a lot
For both of the options you presented, what happens if more than one app_packings_delay have the same date_add value?
@Steve it is a timestamp (datetime) so I hope it will not happen
I think option 2 is your best route.
In terms of efficiency, maxrow() is pretty efficient (especially over a select()) and lookup() is fast as well.
Where were you going to use this? A virtual column, in a workflow, a column value?
I use it in a virtual column
Just FYI, formulaโs like this:
while being efficient, they can cause a slowdown during the sync process if you have a lot of data - the reason being is that for every row in the table with this formula, itโs running through that calculation.
Just something to keep in mind as your app collects more data, things like this start to become more and more costly. If you notice things getting slower you might consider moving that virtual column to an actual column, this way the data is stored instead of calculated on the fly.
Indeed. in this case I would just use workflows to go and update the column when I had a delay. It would even be faster with a trigger in the database but there is no action to force the synchronozation of the app when it is done.
Itโs only recently really becoming widely used, but theyโre actually is a way to force a sync.
But keep in mind: itโs still a sync, it takes time. Be judicious.
You are right indeed. It might not be the best solution yet.
Good to konw indeed. Thanks a lot !
User | Count |
---|---|
35 | |
34 | |
26 | |
23 | |
18 |