M Code Flashcards

1
Q

Text.split

A

text.split([Column Name],” “) -> return a list

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Comment

A

//

/*
multi-line
*/
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

manual input a list

A

= {“A”,”B”}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

pick a column and turn it to a list

A

click on
last_step[Column name]

or
select column -> right click -> drill down / add as new query”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

distinct list

A

list.distinct

or just click remove duplicates”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Filter list

A

List.Contains

= Table.SelectRows(#”Last Step”, each List.Contains(Filter_list, [Field in table])= true )

normall add as new custom column first, then change it to SelectRows

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

List.Buffer

A

no need to reload the filter condition for every row but it should be outside of the “each” iteration, i.e. add a step to read in the buffered list before using it

List.Buffer ( List A)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

List Naming

A

list better not start with a number => otherwise need to use #”Field ABC” instead of just Field_ABC

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Table.Selectrows

A

Table.Selectrows(Table, each condition)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

get a list at source step (drill down)

A

using “Field Access Operator” [Field]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

List.IsEmpty and List.Intersect

A

List.IsEmpty(List.Intersect({Text.Split([Product_Name],” “),NOT_filter}))

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Query and Field convention

A

If the query/step is properly named (i.e. not start with a number and no space), just use it directly.
If it is not properly named, use #”Table A”
Field uses []
List use curly {}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Extracting Current workbook Name range as string

A

Excel.CurrentWorkbook(){[Name=”Table_6_DyanmicPathInput”]}[Content][Column1]{0}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

and or condition

A

Table.SelectRows(#”Changed Type”, each ([Con1]= “A” and [Con2]=”B”) or [Con3]=”C”)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly