Identify recent record by date
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 353
- Joined: Wed Apr 06, 2005 8:45 am
Identify recent record by date
Hi,
We have SCD process. I need to read the records for a given set of keys and extract the row with highest Date value. Have searched in the forum but all of them are pointing on how to implement SCD , here I need to extract the record which has multiple occurances.
Thanks,
We have SCD process. I need to read the records for a given set of keys and extract the row with highest Date value. Have searched in the forum but all of them are pointing on how to implement SCD , here I need to extract the record which has multiple occurances.
Thanks,
Re: Identify recent record by date
Is there a reason why you can't sort the data to get the max date?
-
- Premium Member
- Posts: 353
- Joined: Wed Apr 06, 2005 8:45 am
-
- Premium Member
- Posts: 353
- Joined: Wed Apr 06, 2005 8:45 am
Not quite sure what the actual question here is, but if I understand correctly you want the record with the max date if it gives you 4 occurences ?
If you want to do it in DS instead of doing it in the Database's SQL (which would be the better way of doing it), try an order by clause in your source, ordering by the date column. Then pump it into a hash file.
The hash file will overwrite the duplicates with the next incoming record.
So when the process is finished the hash file will contain a distinct group of records with the max date of each unique key.
LONG way of doing it though...
Morne
If you want to do it in DS instead of doing it in the Database's SQL (which would be the better way of doing it), try an order by clause in your source, ordering by the date column. Then pump it into a hash file.
The hash file will overwrite the duplicates with the next incoming record.
So when the process is finished the hash file will contain a distinct group of records with the max date of each unique key.
LONG way of doing it though...
Morne
-
- Premium Member
- Posts: 353
- Joined: Wed Apr 06, 2005 8:45 am
-
- Premium Member
- Posts: 353
- Joined: Wed Apr 06, 2005 8:45 am