Advanced search: a possible pitfall

    Some of you will think that I'm writing about a very trivial topic. However nearly every day I find examples at the community using advanced search (expression search) and sometimes I'm in doubt, if people will get really the result they're expecting...


    Let me elaborate an example. The question could be:


    "I like to concat every field A where field B is NULL. How do I achieve that?"


    Then the counter question could be:

    "Are there real null() values or whitespaces?"

    Some people don't understand that question at all. So the standard answer contains advanced search in combination with len(trim(FIELD))=0, because that variant doesn't distinguish between null() and whitespaces.

    My example is very simple:

    (containing 2 whitespaces)

    The solution posted could look like that:


    concat({<A={"=len(Trim(B))=0"} >} A,' | ')

    It seems to work flawlessly. Now I'll change the input data slightly.

    The result will be the following:

    Did you really expect that result? In my eyes using expression search like that in combination with fields that don't have 1 to 1 relationsships is quite negligent.


    Please feel free to add comments.


    (used QV12.10 SR4)