3 Replies Latest reply: Mar 23, 2016 5:31 AM by Gysbert Wassenaar RSS

    Set Analysis : 2 conditions on same field

    Emmanuel Damiano

      Hello everyone,


      I have in my Qlikview a few set analyses having 2 conditions on the same field, like for instance "Date > X AND Date < Y", and I am wondering what is the difference between the two following syntaxes:

      Date = {">=$(v_Today)"}*{"<=$(v_variable)"}

      Date = {">=$(v_Today) <=$(v_variable)"}

      After running a few tests, I feel like the second syntax sometimes works like an "AND" and sometimes like an "OR", why is that?

      Actual case :

      This seems to work (Formatted date is a YYYYMMDD-formatted string, just as the two variables, calculated in the script):

      FormattedDate = {">=$(v_DateToday) <=$(v_DateSixMonths)"}

      But this doesn't, it behaves like a "OR":

      FormattedMonth = {">=$(=min(START_DATE)) <=$(=max(END_DATE))"}>}

      and I had to correct it by

      FormattedMonth = {">=$(=min(START_DATE))"} * {"<=$(=max(END_DATE))"}>}

      (Formatted month is a YYYYMM-formatted string, and START_DATE and END_DATE are two YYYYMM-formatted ID fields, impacted by the selection of the equivalent labels in a Multi box)