Skip to content

Commit

Permalink
Remove errors from list (not column)
Browse files Browse the repository at this point in the history
Takes list as input and returns the same list but without Error values.
  • Loading branch information
hohlick committed Oct 17, 2016
1 parent 8d20462 commit c92edad
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions List.RemoveErrors.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
(ListWithErrors as list) as list =>
/*
Takes list as input and returns the same list but without Error values.
Useful when errors came to list/column from external source, and there are no possibility to eliminate errors before using a list

Usage:
= List.RemoveErrors({1,2,error "this is an error",4})
returns
{1,2,4}
*/

let
CleanList = Table.RemoveRowsWithErrors(Table.FromColumns({ListWithErrors}))[Column1]
in
CleanList

0 comments on commit c92edad

Please sign in to comment.