Forum Discussion
Text from a specific row based on codintion
- 3 years ago
Hi nishi
This will return text rather than a table
= Table.SelectColumns(Table.SelectRows(Table, each [Environment] = Parameter and [File] = "FileA"), "URL")[URL]{0}The way this works is that I've added [URL]{0} to the end of the line.
[URL] extracts the column called URL from the table. This column is a list.
{0} extracts the first item in that list, the URL that you want.
regards
Phil
Hi nishi
There's no function to do this. You just have to know that table columns are lists. You can access/store the column by referring to the table name and the column like so: Table[Column]
Lists are like arrays and are indexed from 0, so to access the first item in the list you can use Table[Column]{0}
I'm sure I've seen a Microsoft article talking about lists, records and tables but can't locate it now, sorry.
Regards
Phil
Great PhilipTreacy
To be honest, the concept of lists, arrays, tuples and so on are straight forward to me as I have some base of Python, my question was just to confirm that sometimes I have to abstract the functions and deep dive into basic programming.
I am learning M now thinking on functions fisrtly but it seems they are not always mandatory.
Thanks for the help!