Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sparsely populated field

I have a table with the following data

 

OpsEntityKeyOpsBalanceOpsShareDate
010001-227562555/28/2015
010005-2276520005/28/2015
010007-316655225/28/2015
010007-353888205/28/2015
010001-2271000000.005/29/2015
010005-2273500000.005/29/2015
010007-3162500000.005/29/2015
010007-35333967452.005/29/2015
010001-2271000000.006/1/2015
010005-2273500000.006/1/2015
010007-3162500000.006/1/2015
010007-35333967452.006/1/2015

What I would like to do is "fill in" the missing dates for 5/30 and 5/31 with the previous balance amounts (this should apply to any dates which are missing). I found this thread which could work for this:

How to populate a sparsely populated field

However, I am having trouble getting this to work with the three columns since the date ranges can be different depending on the Entity Key. The only thing I can think of is doing a loop and filtering the data by entity key, creating the temp tables with just the balance and date, and then doing the join, populating this into a temp table, and finally concatenating the next set of data to the end.

Just wondering if there is a more efficient way of doing this? Any help is appreciated.

1 Solution

Accepted Solutions
swuehl
MVP
MVP

You should be able to do this analog to what I've demonstrated here:

Autogenerate currency rates

Analogy should be EntityKey <-> Currency, OpsBalance <-> Rate

View solution in original post

2 Replies
swuehl
MVP
MVP

You should be able to do this analog to what I've demonstrated here:

Autogenerate currency rates

Analogy should be EntityKey <-> Currency, OpsBalance <-> Rate

Not applicable
Author

This worked! Thanks for help