Forum Discussion
Justas4478
1 year agoPost Prodigy
Selective replace mcode
Hi, I have this table where employees do not have warehouse attached to them. There are multiple reason why that could not be the case, but becasue of that I had to group them all as "Unknown" ...
- 1 year ago
the syntax you are using is wrong. Suppose you have a query called your_table that brings you this initial table:
Create blank query, open advanced editor and replace everything inside it with the following code:
Table.ReplaceMatchingRows( your_table, { {[Staff Number = 21000361, Warehouse = "Unknown"], [Staff Number = 21000361, Warehouse = "Gate 2"]}, {[Staff Number = 21007164, Warehouse = "Unknown"], [Staff Number = 21007164, Warehouse = "Gate 5"]} } )Result is:
Make sure you know what are lists and records as well as list of records and their syntax in M. Otherwise it won't be easy for you to implement and support my solution.
Omid_Motamedise
1 year agoSuper User
Use the function table.replacevalue