8 Replies Latest reply: Sep 21, 2016 6:39 AM by Gysbert Wassenaar RSS

    Dynamic mask expression for wildmatch

    Teemu Pitkänen

      Hey,

       

      Is it possible to give Wildmatch() a dynamic mask expressions based on fields in the data? I've attached an example application that illustrates what I'm trying to do. I'd like the Result/Result2 fields to be TRUE if any of the values in "Mask" field matches with the value in the "Dim" field. So in my example, rows 1,2,4 and 5 should be TRUE.

       

      It seems to me that if the second parameter for Wildmatch is based on a field value (not a static string or a variable), QlikView compares the first parameter to the WHOLE mask, not the individual parts. I'm sure this can be solved by using loops and/or variables in some way but I'd like to avoid those in this case.

       

      edit: if the data contains values "AAA", "AAAA" etc. it should NOT match with "A". "A*", "AA*" etc. should match though.

      edit2: by using SubField() it's possible to extract individual values to get the correct result. Is there a way to do it without SubField though since it does generate (potentially) a lot more rows?

       

      -Teemu