List.Alternate

The function retrieves a list of elements with odd-numbered offsets from a given list. It follows a pattern of selecting and skipping values from the list based on the specified parameters: - count: D...

Syntax

List.Alternate(list as list, count as number, optional repeatInterval as nullable number, optional offset as nullable number) as list

About

The function retrieves a list of elements with odd-numbered offsets from a given list. It follows a pattern of selecting and skipping values from the list based on the specified parameters: - count: Determines the number of values to skip each time. - repeatInterval: An optional parameter that specifies how many values are inserted between the skipped values. - offset: An optional parameter that indicates where to start skipping values from the initial offset position.

Explanation

Generate a list using Power Query MList from the range of numbers 1 to 10, excluding the first number. Usage: Power Query MList.Alternate({1..10}, 1) Output: {2, 3, 4, 5, 6, 7, 8, 9, 10} Generate a list using Power Query MList from the range of numbers 1 to 10, skipping every other number. Usage: Power Query MList.Alternate({1..10}, 1, 1) Output: {2, 4, 6, 8, 10} Create a list using Power Query MList from the range of numbers 1 to 10, starting at 1 and skipping every other number. Usage: Power Query MList.Alternate({1..10}, 1, 1, 1) Output: {1, 3, 5, 7, 9} Generate a list using Power Query MList from the range of numbers 1 to 10, starting at 1, skipping one value, keeping two values, and repeating the pattern. Usage: Power Query MList.Alternate({1..10}, 1, 2, 1) Output: {1, 3, 4, 6, 7, 9, 10}