I think the logic for ifempty is not explained properly in the hint (I should not call it documentation). Typically you would expect the behavior like this:
ifempty(expression, result1, result2)
If the result of expression is empty then “result1” is the output otherwise “result2”.
But actually what is happening is that if expression is empty then result1 is the output. but if it is not empty, then the output of the expression is the output. Result2 is completely ignored.
Is this a bug? Or simply my misunderstanding of the function?