Forum Discussion
Error message : Expression.Error
Hello everyone,
I am trying to reproduce the exercise in this link, but the query returns an error message.
https://we.tl/t-RdkGCHe1LK
Can you help me correct the error?
Thank you in advance.
Best regards
The result I got without the error message I obtained by editing the _ValidateAge function. I pointed out the problem with what you sent me in a previous message. However, the result is not correct as none of the emails were properly validated. You will have to correct that.
The _ValidateAge method that I used is was to just check the ages to ensure that they are a integer.
(data as nullable text) as logical => let isValid = (try Int64.From(data))[HasError]=false in isValidBut you are going to have to edit your _ValidateEmail function as it is returning an incorrect result
9 Replies
- ronrsnfld
Super User
This line is incorrect:
Source = RunDataQualityCheck(MyTestTable, "MyTestTable", DataQualityActionTable)DataQualityActionTable is the name of the variable. You need to replace that with the name of the appropriate table.
- ronrsnfld
Super User
Examining the lesson more closely, it seems there are multiple errors.
The cause of your specific error is in the _ValidateAge function. You copied it verbatim from the lesson as
(data as nullable text) as logical => let isValid = if [YourValidationRuleHere] then true else false in isValidContrary to the instructions, you did not replace [YourValidationRule] with a functioning validation rule, hence the error which propagates to your result.
Please note that the lesson suggests with regard to the Validation Functions: "You can easily debug your M code by adding a custom column to your original table." Had you done that, you would have found the error when you checked that validation rule.
You should do that anyway to ensure the rules function as you wish.
On the good side, it seems that the RunDataQualityCheck code does seem to work properly, so once you get the actual rules sorted, you should be OK.
Good learning experience!