Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I’m trying to figure out how to pull the previous contract’s details from a master table. Here’s the setup:
CustomerID, ContractID, TransDate, Disbursed Amount
Every time a contract is completed, a new ContractID is created. What I need is:
For any current contract, get the date and amount of the previous contract.
If a customer has multiple past contracts, I only want the most recent one before the current contract.
I’d love to see how you’d approach it, either in the script or using chart expressions. Any tips, examples, or best practices would be great.
Thanks!
Hi @LoKi_asterix, one possible option is this script, that create a couple of new fields with the desired data using very common peek and previous inter record functions
Script:
Hi @LoKi_asterix, one possible option is this script, that create a couple of new fields with the desired data using very common peek and previous inter record functions
Script:
The suggested solution by @QFabian is pretty much in line with how I would solve this as well.
I suggest you give it a try, and accepy the suggestion as a solution if it turned out to fit your needs, or add a new comment here if it is not what you are looking for.