merge data

keessieb

Board Regular
Joined
Mar 5, 2003
Messages
177
I'm working with a 90 MB Access file looking like this:
Book1
ABCDE
1ArticleNameIngredientPriceAmount
2123Cakek100023,54
3123Cakek2999105
4123Cakek333212,035
5568Piek272225,338
6568Piek100023,52
Sheet1


Is there a way to get it like this?
Book1
ABCDEFGHIJKLMN
1ArticleNameIngredientPriceAmountIngredient2Price2Amount2Ingredient3Price3Amount3Ingredient4Price4Amount4
2123Cakek100023,54k2999105k333212,035000
3568Piek272225,338k100023,52000000
Sheet1


Would be a nice method to make it a "real" database! (And a lot smaller too!!

Many thanks in advance!
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Actually, they way you have the data stored now is not only a "real database", it is actually in a better Access format than the second one you wish to switch it to (it is considered to be in better form, and allows for more flexibility).

For example, let's say you wanted to search the table for everything that uses ingredients k2999. In your first table, you would only have to search one field. In your second, you would have to search multiple fields. Also, what happens if have to add new items that have 5,6,7, etc ingredients? You would have to keep adding fields to your table, and your any queries would have to be modified. Not good design!

The great thing about Access is that you can take a table that is in normal form, and get almost anything you want out of it. If you have the table in the original form you have displayed, you can simply create a Cross-Tab query to display the data in the form you wish to show it in.

You want to reference Access help or Access books for more information on "Normal Forms" of data, which talk about the best way to design tables, and check out the different types of queries you can create (especially cross-tab queries, in this instance).
 
Upvote 0
I agree with the first post -- you already have the data in the correct format. To get what you want, build a report. You'll have a slightly different layout when you finish -- something like

Article 123 Name Cake

Ingredient Price Amount
k1000 23,5 4
k2999 10 5
k3332 12,03 5

etc.

You can also insert fields for Ingredient Count, total value of ingredients, and more.

Hope that helps.
 
Upvote 0
I am going to disagree with the others :) The first table, if it is a single table, has not been normalised. It looks as if it should be split into at least two or three separate table judging by the sample given. The file will be bloated because it contains a lot of repeated data that should be stored once in a lookup table.
Unless there is a lot of data 90mb still sounds very large. In Access pictures can rapidly bloat the file size so if you are storing them it is worth looking at storing them separately and referencing them form the DB.

Have you tried repairing/compacting the DB to reduce its size?

This link on Normalisation is not Access specific but will give you the basic ideas of table structure

HTH

Peter
 
Upvote 0
Yes, it is true that the first table could be normalized further, especially with Name seeming to be dependent on Article. The point I was trying to make is that the poster's proposals were moving away from normalization, not towards it, and that could be a limiting factor down the road.

I also asked them to check out the information on normalization for table design.
 
Upvote 0

Forum statistics

Threads
1,221,553
Messages
6,160,468
Members
451,649
Latest member
fahad_ibnfurjan

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top