Forum Discussion
How to avoid nested IF loops
- 10 years ago
assuming your timestamp is generated, then they match a specific pattern - one that you can use to split the column into junk and the actual error string.
Once you have the cleansed column, you can generate the error type in mutiple ways.
1. In the query editor, use a custom column and the if ... then ... else M syntax
2. As a calculated column
3. As look up table in the query editor defined as a join.
Some other thoughts: if it's possible, you should try to solve this at the source of the problem, when the errors gets generated, insert an error code/type so uniquely identify them. String searchs are never too reliable.
assuming your timestamp is generated, then they match a specific pattern - one that you can use to split the column into junk and the actual error string.
Once you have the cleansed column, you can generate the error type in mutiple ways.
1. In the query editor, use a custom column and the if ... then ... else M syntax
2. As a calculated column
3. As look up table in the query editor defined as a join.
Some other thoughts: if it's possible, you should try to solve this at the source of the problem, when the errors gets generated, insert an error code/type so uniquely identify them. String searchs are never too reliable.
- sguenther10 years agoAdvocate II
Oh this seems to be probably the best idea. Could you go into some more detail how this would look like?
Regarding the error logging: will definitely be changed in the future, but can't be changed for the past. So I have to live with what I have for now and solve it in PowerBI