We help IT Professionals succeed at work.

merge all cells from all columns into a single list.

70 Views
Last Modified: 2019-02-14
is there an easy way in access, to merge all data in all fields into a single list? I have received some data and it looks like 95% of the cells in most columns are empty, but I need an automatic way to merge all data from all columns which are not blank into a single list of data/column of data. Any suggestions if this can be done? there are over 60'000 rows of data, the first column is full of entries, but then there are dozens of fields and 95%  of them seem to be blank, so merging all cells in the table from all fields, where the cell is not blank would be a great help. Is there also a limit on the number of fields you can import into access?
Comment
Watch Question

NorieAnalyst Assistant
CERTIFIED EXPERT

Commented:
What do you mean by 'cells'?

An Access table doesn't have 'cells' it consists of records with fields.

Do you mean that you have multiple records where the majority of fields are empty?

Are there any fields that are have a value for all records?

Author

Commented:
records within fields then.
Do you mean that you have multiple records where the majority of fields are empty?
yes
Are there any fields that are have a value for all records?
o 60k rows yes there are less than 10 rows where theres a value in every field in that record.
aikimarkSocial distance; Wear a mask; Don't touch your face; Wash your hands for 20 seconds
CERTIFIED EXPERT
Top Expert 2014

Commented:
Are you trying to 'merge' multiple fields into a single field through concatenation or are you trying to 'normalize' the table data into multiple rows?

A representative before and after data sample would be helpful

Author

Commented:
No not through concatenation as such, just appending all valid entries to the end of the entries (non blanks) in field A, for every column. so if there were 60k rows in column A (no blanks), then50 non blanks in field B, and 20 non blanks in field C etc etc, then the result would be all the non blanks from A, B, C in one list, with 60'070 entries. The problem is I have over 220 'fields'.

A very quick before and after would be:
field A-Field B-Field C
---------------------------------
1-(blank)-(blank)
2-blank)-(blank)
3-4-blank)
4-(blank)-6
5-(blank)-8

would show as

1
2
3
4
5
4
6
8
Social distance; Wear a mask; Don't touch your face; Wash your hands for 20 seconds
CERTIFIED EXPERT
Top Expert 2014
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
CERTIFIED EXPERT
Distinguished Expert 2017

Commented:
I think Excel has a convert columns to rows option that might do this.  The issue would be, do you end up with too many rows for your version of Excel to handle?  This will only take a little automation code and then you can link to the  updated sheet or import the data.

As aikimark mentioned, you are going to get a "too complex" error for a union well before you get to 220 columns.  I would use a VBA loop that iterates through the columns of the linked spreadsheet and builds and runs an append query for each separate column selecting only non-null (and possibly non-ZLS - which are different) values.

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.