I'm really struggling with this...
I start with a collection: ScanDataCollection_SmartComm_MasterList
It looks like this:
Result
REQ1991799.RITM2280596.01
REQ2048874.RITM2349401.01
REQ2037354.RITM2335400.01
I have a database table: Master_Transaction_Log
...which has three particular columns of interest:
Timestamp
Scan_Code
Transaction_Type
I would like to end up with TWO collections:
SC_ReturnToDepot
Result
REQ1991799.RITM2280596.01
SC_Remainder_1
Result
REQ2048874.RITM2349401.01
REQ2037354.RITM2335400.01
The criteria is as follows: for any given Result in ScanDataCollection_SmartComm_MasterList, if:
A database record has Scan_Code = Result AND Transaction_Type = "New Equipment Delivery - Cust. Msg: Equipment Returning to Depot" AND Timestamp > 72 hours ago, then that value of Result is added to SC_ReturnToDepot.
SC_Remainder_1 are all remaining values that do not fit the above criteria.
I've narrowed this down to one single line...
A sample of my code, with three examples:
ForAll(ScanDataCollection_SmartComm_MasterList,
If(
// line 1 (LookUp(Master_Transaction_Log, Result in Scan_Code).Scan_Code) in Result,
// line 2 (LookUp(Master_Transaction_Log, "Comms Lockoff" in Transaction_Type).Scan_Code) in Result,
// line 3 (LookUp(Master_Transaction_Log, "Comms Lockoff" in Transaction_Type And Result in Scan_Code).Scan_Code) in Result,
Collect(SC_OnCommsHold,ThisRecord),
Collect(SC_Remainder_1,ThisRecord));
);
My database has one single entry that fits the above criteria.
- When I uncomment only line 1, the routine runs great. SC_OnCommsHold receives one record, and SC_Remainder_1 gets the other three.
- When I uncomment only line 2, the routine runs great. SC_OnCommsHold receives one record, and SC_Remainder_1 gets the other three.
- When I uncomment only line 3, the result fails. SC_OnCommsHold receives no records. All records get piled into SC_Remainder_1
It seems to me like it's got to be some sort of logical error in line 3, but I an absolutely baffled.

Report
All responses (
Answers (