Hello friends
I have a new requirement, but I am unable to resolve it with minimum time spent in a loop and/or the requirement per say.
We have a PSA source with the following fields
Tag | Service No. | ERDAT |
A | 123 | 20150401 |
A | 345 | 20150402 |
A | 567 | 20150420 |
Now we move this in a DSO (key field: Service no.). The user wants another field namely RDR which should populate it according to the following logic:
If for the same tag the ERDAT is within 7 days of previous ERDAT, then RDR = 'yes', else RDR='no'. Also, the first occurrence must be RDR='blank'.
Hence, after end routine, the DSO should look like this:-
Tag | Service No. | ERDAT | RDR |
A | 123 | 20150401 | |
A | 345 | 20150402 | Yes |
A | 567 | 20150420 | No |
Now, the problem is that the source brings in 7 days of data. Hence, all the 7 day old records/line items come up every time DTP fetches the records.
Can you please let me know the logic atleast to handle this scenario. Ive tried several ways but it doesnt give the correct results or in the shortest period of time.