This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| FUNCTION NAME: SplitAmount | |
| VERSION:1.0 | |
| AUTHOR: Mahmoud Baniasadi | |
| WEB: www.arshad-hesabdar.ir | |
| INSTAGRAM: @SoftwareTrain | |
| DESCRIPTION: Split each number to a specific number. | |
| ARGS: | |
| array: a column include lable. | |
| amount: amount to split to a nth number of devision. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Filters a column using a predicate. If 'positions' | |
| is set to TRUE, returns the indices of the results | |
| instead of the values */ | |
| FilterBy = | |
| LAMBDA(col, predicate, [positions], | |
| LET(returnPositions, AND(NOT(ISOMITTED(positions)), positions=TRUE), | |
| indices, SEQUENCE(ROWS(col)), | |
| IF(returnPositions, | |
| FILTER(indices, MAP(col, predicate)), | |
| FILTER(col, MAP(col, predicate))))); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Maps a function on the cells of the given column, | |
| and stacks the resulting arrays. | |
| If the resulting arrays are jagged, rows are | |
| padded with the padding if provided else #NA. | |
| TODO: does not account for the case where the | |
| function application produces an error. | |
| */ | |
| MapStack = LAMBDA(col, fn, [padding], [stack_original], | |
| LET(Thunk, LAMBDA(value, LAMBDA(value)), | |
| UnThunk, LAMBDA(thunk, thunk()), |