I have a query that links to a website and pulls data. Every seven days two of the columns change as below:
MONDAY2 to MONDAY3
TUESDAY2 to TUESDAY3
I get errors when I refresh. Is there a way to automate this so it adjusts without errors? THanks.
I have a query that links to a website and pulls data. Every seven days two of the columns change as below:
MONDAY2 to MONDAY3
TUESDAY2 to TUESDAY3
I get errors when I refresh. Is there a way to automate this so it adjusts without errors? THanks.
Isn't this the same question you posted half an hour ago here: https://www.excelforum.com/excel-pro...ata-pull.html?
Rory
yes. I am new here and when I checked my first post it wasnt showing up.
Not nearly enough detail to help you.
Each web site requires different treatment or custom steps to extract info.
But chances are, that column name change caused error somewhere in your query step. Go into query editor and see at which of the applied steps that error is produced.
Then, add a logic and/or custom function to avoid this error.
Such as using Table.ColumnNames function etc.
?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
― Robert A. Heinlein
The website I am using just pulls the data in flawlessly for a week when the column is MONDAY2. When the next Monday rolls around the column name changes to MONDAY3 and I get an error because it is looking for MONDAY2 (that is where the error is occuring halting the data pull). I am just starting with Power Query so wanted to know if there is a simple fix to automate this.
Right, so instead of using Column Names, you need to use Column positions.
In order to do that, you'd use Table.ColumnNames() function to obtain list of column names. Then use row index to obtain column name(s).
Then use result as is, or in a variable to replace column names that are are hard coded in the query editor with dynamic name.
Ex:
Please Login or Register to view this content.
Thanks for your help.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks