Module 16
M language basics
Values, let … in, records and lists.
You'll be able to
- Read and write let expressions
- Work with records and lists
- Understand step references
Lessons
- 1.M basics: let, records and listsWrite small M expressions with let, lists and records.
- 2.Identifiers, quoted names, escapes and commentsRead and write names, text escapes and comments without syntax errors.
- 3.Lists in depth: build, transform, select and accessUse list functions confidently to compute values that would be awkward with table steps.
- 4.Records in depth: fields, defaults and combiningRead, build and combine records, including ones with missing fields.
Take the m language basics quiz (8 questions)
Exercises
- intermediate~9 minPro
Build a one-row summary table in M (kite shop)
Write a let expression that computes order count, total quantity and the largest unit price, returned as a one-row table.
- intermediate~9 minPro
Build a one-row summary table in M (bakery)
Write a let expression that computes order count, total quantity and the largest unit price, returned as a one-row table.
- intermediate~9 minPro
Build a one-row summary table in M (bike rental)
Write a let expression that computes order count, total quantity and the largest unit price, returned as a one-row table.
- intermediate~9 minPro
Build a calendar from the first to the last order date (kite shop)
Create a table with one row for every day from the earliest to the latest order date, including days with no orders.
- intermediate~9 minPro
Build a calendar from the first to the last order date (bakery)
Create a table with one row for every day from the earliest to the latest order date, including days with no orders.
- intermediate~9 minPro
Build a calendar from the first to the last order date (bike rental)
Create a table with one row for every day from the earliest to the latest order date, including days with no orders.
- beginner~6 minPro
Turn a settings object into a Name/Value table (report config)
A JSON settings file is a single object. List its settings as rows with Name and Value columns.
- beginner~6 minPro
Turn a settings object into a Name/Value table (app config)
A JSON settings file is a single object. List its settings as rows with Name and Value columns.
- intermediate~7 minPro
Find customers who ordered in January but not in February (kite shop)
Compare the customer lists of two months and return the customers who didn't come back.
- intermediate~7 minPro
Find customers who ordered in January but not in February (bakery)
Compare the customer lists of two months and return the customers who didn't come back.
- intermediate~7 minPro
Find customers who ordered in January but not in February (bike rental)
Compare the customer lists of two months and return the customers who didn't come back.
- intermediate~8 minPro
Flag orders priced above the average (kite shop)
Compute the average UnitPrice once in a let variable, then flag each order above it.
- intermediate~8 minPro
Flag orders priced above the average (bakery)
Compute the average UnitPrice once in a let variable, then flag each order above it.
- intermediate~8 minPro
Flag orders priced above the average (bike rental)
Compute the average UnitPrice once in a let variable, then flag each order above it.
- intermediate~8 minPro
Find the missing numbers in an invoice sequence (invoices)
Invoice numbers should run without gaps. List the numbers missing between the smallest and the largest.
- intermediate~8 minPro
Find the missing numbers in an invoice sequence (tickets)
Invoice numbers should run without gaps. List the numbers missing between the smallest and the largest.
- beginner~6 minPro
Label what kind of value each cell holds (survey import)
A free-form import column mixes numbers, text, dates, true/false and nulls. Add a Kind label for each.
- beginner~6 minPro
Label what kind of value each cell holds (legacy sheet)
A free-form import column mixes numbers, text, dates, true/false and nulls. Add a Kind label for each.
- beginner~5 minPro
Default missing quantities with the ?? operator (kite shop)
Unknown quantities ship as 1 by policy. Add Ship Qty that uses Qty when it's known and 1 when it's null.
- beginner~5 minPro
Default missing quantities with the ?? operator (bakery)
Unknown quantities ship as 1 by policy. Add Ship Qty that uses Qty when it's known and 1 when it's null.
- beginner~5 minPro
Default missing quantities with the ?? operator (bike rental)
Unknown quantities ship as 1 by policy. Add Ship Qty that uses Qty when it's known and 1 when it's null.