Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Looking up latest row?

Status
Not open for further replies.

Goodie666

Programmer
Nov 24, 2008
44
CA
Hi,

For those who've read my previous post, I'm still trying to design my little sample data warehouse :). I'm trying to have, in my fact table, an attribute that links to the previous fact row.
My fact is:

ID
ProductID
TimeStamp
PreviousStamp (that's the one I'm trying to fill).

In other words, when I process the staging table row, I need to lookup the previous TimeStamp for the same ProductID (there may be multiple ones). Do you think that using a regular lookup transform having an ORDER BY TimeStamp clause in its reference dataset, counting on the fact that the lookup will return the first match a good strategy?

I was otherwise thinking of having the 'CurrentRow=Y' kinda scheme in my fact but I think having to go and update the fact table back at the end of the process is a bit too much work for what I'm trying to achieve...

Any thoughts/suggestions on this are welcome :)

Thanks,

Greg

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top