Forum

Get data from.........
 
Notifications
Clear all

Get data from....... Expression.Error

2 Posts
2 Users
0 Reactions
68 Views
(@psychson)
Posts: 2
New Member
Topic starter
 

Hi,

I have two recurring issues , very similar and I still can't figured out how to get around it in a more efficient way. 

1.Get Data from Access Database -  I have access files(tables)  provided to me weekly and until a year ago the tables were consistent but  lately,  people managing the data are making changes in columns, adding  or deleting it.

After I had set up my query and having no issues linking it to those access tables, very often now I get an error saying [Expression.Error] The column 'xyzxyzxyz ' of the table wasn't found.  My workaround now is to keep adding  "dummy" columns to replace the ones taken out or my query won't refresh.  

Is there a way to have power query get data from access tables and ignore columns that now no longer exist and prevent the error from happening when refreshing the data ? 

2.Get Data from Workbook - I'm also given an excel with technicality the same columns every month. I say technically because the columns headers will have a date of the month added to it.  It's a monthly update and each header will display the date of the month. So, I get the same error above, because month is not the same and column displays headers with a different text . Such as: "Customer info for 01/01/2020" and other columns also have 01/01/2020 in it but not all. columns.  Now in February , columns will have date of 02/01/2020 instead of January date and so on. 

In this case, is there any workaround in power query besides cleaning the data prior to importing ?  

If anyone has any insight I would appreciate it . Either way it has become a time consuming process and I  have to start over every time  there's a change in those access tables or as said, insert dummy columns.  The excel files I'm trying to have the people providing the data to remove date from the header, but I haven't been lucky yet. 

Thank you so much

Sonia 

 
Posted : 16/01/2020 3:47 pm
(@catalinb)
Posts: 1937
Member Admin
 

Hi Sonia,

Take a look at the code in Advanced Editor.

Wherever you have to expand a table, column names are hard typed when you do this operation manually. You can replace the manual list of column names with Table.ColumnNames(TableNameOrPreviousStepName)

If you have an entire column of tables, use Table.ColumnNames(Table.Combine(#"PreviousStep"[ColumnName]))

Table column names are repeated twice.

 
Posted : 17/01/2020 12:13 am
Share: