Forum Discussion
Handle an error in a custom function
- 6 years ago
PQ will not automatacally handle the errors, by design. What should it do? Replace with null, replace with blank, replace with the word "Error?"
The Try/Otherwise construct is exactly for trapping errors and you could use:
try HereIsSomeMath otherwise nulland if it gets an error, it will replace with null. It is a good error handler. LIke IFERROR() in Excel.
Ok, well I just replaced "errors" with "null" and then expanded the table, and that worked as I had hoped. However, I'm still curious if there is a way to automate that in the query itself so I can write it into future queries to just kinda handle the errors without having to do anything
PQ will not automatacally handle the errors, by design. What should it do? Replace with null, replace with blank, replace with the word "Error?"
The Try/Otherwise construct is exactly for trapping errors and you could use:
try HereIsSomeMath otherwise null
and if it gets an error, it will replace with null. It is a good error handler. LIke IFERROR() in Excel.