Forum

Automating repeatin...
 
Notifications
Clear all

Automating repeating steps with Power Query function

19 Posts
2 Users
0 Reactions
626 Views
(@catalinb)
Posts: 1937
Member Admin
 

List.Select will analyze each item from the list.
"_" is the current item from the list.

 
Posted : 09/06/2021 9:53 am
(@jaryszek)
Posts: 177
Reputable Member
Topic starter
 

What do you mean by current?

 
Posted : 09/06/2021 10:08 am
(@catalinb)
Posts: 1937
Member Admin
 

The second argument of List.Select starts an evaluation of the list, from the beginning of the list down to the last item in the list.

The _ is short hand for the current item during this process.

I suggest going more often to the documentation:
https://docs.microsoft.com/en-us/powerquery-m/m-spec-functions#simplified-declarations

The each-expression is a syntactic shorthand for declaring untyped functions taking a single formal parameter named _ (underscore).

Simplified declarations are commonly used to improve the readability of higher-order function invocation.

For example, the following pairs of declarations are semantically equivalent:

each _ + 1 (_) => _ + 1
each [A] (_) => _[A]
Table.SelectRows( aTable, each [Weight] > 12 )
Table.SelectRows( aTable, (_) => _[Weight] > 12 )

You should look here whenever you need something, all you need is documented:
https://docs.microsoft.com/en-us/powerquery-m/power-query-m-function-reference

 
Posted : 09/06/2021 10:37 am
(@jaryszek)
Posts: 177
Reputable Member
Topic starter
 

Thank you very much for such a nice explanation.

 
Posted : 10/06/2021 7:01 am
Page 2 / 2
Share: