Forum Discussion
Extract data from tab based on similar name
Hello,
I am wondering if this is something possible to do.
I receive 30 files per month with two tabs (ie A-aa and B-bb). I need to extract data from tab A-aa. However, some people name it as A-aa, others as A-AA, etc. I am wondering if it is possible to specify the name of the tab so that instead of having Source{[Name="A-aa"]}[Data], I can have Name similar to "aa", for instance.
Hi Anonymous,
you can get all column names of a table and filter out only those which are similar to your pattern.
You will need following functions:
- A list of columns: Table.ColumnNames
- Select the items of a list which match a condition: List.Select
- Get lowercase values for comparing with your pattern: Text.Lower
And then you'll get a new list of column names which you use for selecting columns of your table.
2 Replies
- luisrhResponsive Resident
I would instead iterate thru the files in the folder and load them in that way ...
Here is a blog that helps illustrate the approach -
Good luck.
If this works for you please mark it as a solution. Thank you.
- NolockResident Rockstar
Hi Anonymous,
you can get all column names of a table and filter out only those which are similar to your pattern.
You will need following functions:
- A list of columns: Table.ColumnNames
- Select the items of a list which match a condition: List.Select
- Get lowercase values for comparing with your pattern: Text.Lower
And then you'll get a new list of column names which you use for selecting columns of your table.