PDA

View Full Version : Populate Blank Field With Prior Value



Dr. Siewert
December 9th, 2009, 02:42 PM
In a DBF there is a Description field that has a value at the beginning of a set of data. The discription is needed to autofil until the data set changes. For example:

The catagory is blank for this record. I would like to have the Catagory from the previous record fill in.

Currently Data Looks like this:

ACCT. AMT. Catagory

1234 $12.50 Revenue
1256 $25.60
"
"
2123 $15.00 MOB Expenses
2345 $14.65

It should look like this:

1234 $12.50 Revenue
1256 $25.60 Revenue
"
"
2123 $15.00 MOB Expenses
2345 $14.65 MOB Expenses

Data Kruncher
December 9th, 2009, 03:24 PM
Hi Dr.,

There's a theme today it seems with data sharing between records when using database sources. :)

Accordingly, I have a two pass solution to recommend.

First, open your DBF file as you do normally. Build and run a project export from the Table windows to create a fixed-length text file. In effect, this will output the Table as a report file. Save the model and the project files for later reuse.

Now open the new text file as a conventional report and model it, employing the "Copy value from previous record" mechanism in the field properties. Again, save the model (and project if desired).

That ought to do it.

HTH,
Kruncher

Dr. Siewert
December 9th, 2009, 05:54 PM
Thanks for the tip... I acutally was going to do that originally. But was anticipating a slicker workaround. But as long as job gets done... we do what ever is needed. Thanks again.

Harald

Data Kruncher
December 9th, 2009, 06:11 PM
Don't forget to create a little batch file that will run both steps for you. One extra minute of effort now makes it so easy to do the work when you need to do it again later.