2 Replies Latest reply: Dec 12, 2011 11:53 AM by Boris Nechaev RSS

    Intersection of two fields.

      Hello!

       

      I load two fields with IDs: id1 and id2. Each of the fields also has date dimension (date1 and date2) associated with them. I need to write an expression that given the current date1 and date2 selection will count number of IDs that are in both ID fields. I could also use an expression that finds the difference between the fields, i.e. IDs that are in id1, but not in id2.

       

      If the above is unclear, here is an example.

       

      date1id1
      11/19/20111
      11/19/20112
      11/19/20113
      11/19/20114
      11/20/20115
      11/20/20119

       

      date2id2
      11/23/20111
      11/23/20113
      11/23/20114
      11/23/20117
      11/23/20118
      11/25/20119

       

      In the list box for date1 I select "11/19/2011", which leaves IDs {1, 2, 3, 4} in id1. In the list box for date2 I select "11/23/2011", which leaves IDs {1, 3, 4, 7, 8} in id2. I need expressions that will return 3 as the number of IDs present in both fields ({1, 3, 4}) and 1 as the number of IDs present in id1, but not present in id2 ({2}).