Table.ViewError

D

T

The M Code Behind the Power Query M function Table.ViewError

In this article, we will take a closer look at the M code behind the Table.ViewError function, and explore some of the ways in which it can be used to improve the accuracy and reliability of your data.

Understanding the Table.ViewError Function

The Table.ViewError function is a built-in function in Power Query that allows you to view and fix errors in your data. When you apply this function to a table, it will display a list of all the errors in that table, along with a description of the error type and the location of the error.

For example, if you have a table that contains a column of dates, and some of those dates are in an incorrect format, you can use the Table.ViewError function to quickly identify and fix those errors.

The M Code Behind the Table.ViewError Function

The Table.ViewError function is actually a combination of several different M functions that work together to identify and display errors in your data. Here is a breakdown of the M code that makes up the Table.ViewError function:

Table.Buffer: This function is used to create a temporary copy of the table that is being analyzed. This copy is used to perform all of the error checks, so that the original table is not modified.

Table.SelectRows: This function is used to select only the rows in the table that contain errors. It does this by applying a custom error-checking function to each row in the table, and only selecting the rows that fail the check.

List.Transform: This function is used to transform the list of error rows into a more readable format. It does this by applying a custom formatting function to each row in the list, which converts the error data into a user-friendly format.

Table.FromRecords: This function is used to convert the formatted list of error rows into a new table, which is then displayed to the user.

Using the Table.ViewError Function

Now that we understand how the Table.ViewError function works, let’s take a look at some of the ways in which it can be used to improve the accuracy and reliability of your data.

Identifying Data Entry Errors

One of the most common uses of the Table.ViewError function is to identify errors that were made during data entry. For example, if you have a table that contains customer names, and some of those names are misspelled or entered in the wrong format, the Table.ViewError function can help you identify and correct those errors.

Validating Data Formats

Another use of the Table.ViewError function is to validate data formats. For example, if you have a table that contains date values, you can use the Table.ViewError function to identify any values that are not in the correct date format. This can help you ensure that your data is accurate and consistent.

Checking Data Integrity

Finally, the Table.ViewError function can be used to check the integrity of your data. For example, if you have a table that contains product prices, you can use the Table.ViewError function to identify any prices that fall outside of a certain range. This can help you identify and correct any data entry errors or other issues that may be affecting the accuracy of your data.

In conclusion, the Table.ViewError function is a powerful tool that can help you identify and fix errors in your data. By understanding the M code behind this function, and exploring some of the ways in which it can be used, you can improve the accuracy and reliability of your data and make better data-driven decisions.

Power Query and M Training Courses by G Com Solutions (0800 998 9248)

Upcoming Courses

Contact Us

    Subject

    Your Name (required)

    Company/Organisation

    Email (required)

    Telephone

    Training Course(s)

    Your Message

    Upload Example Document(s) (Zip multiple files)