Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

Fill in Column Data using Script Transform

$
0
0

All,

I'm trying to figure out a way to dynamically populate a column as it passes through a data flow task.  My data source is Excel 2007 and the first row of data has data in the say, column B, and then rows 2-50 let say contains blanks for this column. I want to grab this date on the first row and assign it as my column value for all subsequent rows.

I've tried doing this in a script transform and assigning the value to a variable but it seems like it can only write to the variable after all rows have passed through it.  This is where it get's a little more complicated.  Let's say on row 51 there is a new value in column B.  Now I'd like to use this new data as the column B value for rows 52-100.  If the value couldn't possible change, I'd be good with setting this variable at the end of the script transform, but alas no.  

So how can I dynamically set this value in column B as the transform is rolling through the data?

Example:

Original Data

ColumnAColumnB

15/1/2016

2

3

4

5

65/2/2016

7

8

9

10

Final Transform

ColumnAColumnB

15/1/2016

25/1/2016

35/1/2016

45/1/2016

55/1/2016

65/2/2016

75/2/2016

85/2/2016

95/2/2016

105/2/2016

Thanks for any guidance anyone can provide.  

MB


Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>