AnsweredAssumed Answered

Obtaining a stored field from unstored calculation

Question asked by Wicktor on Nov 17, 2016
Latest reply on Nov 19, 2016 by keywords

In a sales database, for having sales statistics related to clients, I have tagged each purchase with 3 different tags

FIRST PURCHASE (the first time a client has purchased a product)

REPURCHASE (every purchase happened after the first time)

LAST PURCHASE (the last time a client has purchased a product)

 

The TAG field is calculated as follows:

Case(

DATE = Min (SELLS::DATE) and DATE ≠ Max (SELLS::DATE); "FIRST PURCHASE";

DATE = Max (SELLS::DATE) and DATE ≠ Min (SELLS::DATE); “LAST PURCHASE";

"REPURCHASE")

 

It works, but only problem it is an un-stored calculation and counting a few hundred thousands records it takes quite long.

I tried using a TAG_STORED text field with auto-enter calculation referring to the relationship: it seems not working since the TAG value is calculated only at record commit.

I tried using a TAG_STORED lookup field. It works, but again it needs to relookup all the database with many hundred thousands records, still quite long.

 

I guess I am following the wrong direction.

Anyone has a brighter idea ?

Victor

Outcomes