2 Replies Latest reply on Jun 21, 2016 1:48 PM by Jeffrey Jacob

    Sets Not Forming Correctly

    Jeffrey Jacob

      Hi All,

       

      I am trying to form a set with the following condition:  Measure "_Customers PY >= 3" = 1.

       

      However, Tableau is forming the group and including some customers with 0 as the value of this measure.  Please see below.

       

      "_Customers PY >= 3" is a calculated field with the following equation:

      SUM({INCLUDE [_Unique Customer]:

      INT(COUNT(IF (YEAR(TODAY()) - YEAR([Transaction Date]) = 1) THEN [_Unique Customer] END) >= 3)})

       

      I would like to use this set to give me a COUNTD of customers which meet this condition.  Specifically, COUNTD(IF [__Customers PY >= 3_Previous Customers Set] THEN [_Unique Customer] END), but it includes the customers with value 0.

       

      As an attempted work-around, I tried to state the following:  IF [__Customers PY >= 3_Previous Customers Set] THEN [_Customers PY >= 3] END.

       

      Tableau, however, does not allow mixing aggregates and non-aggregates.

       

      Do you have any theories as to why the set includes customers which do not meet the stated condition?  Do you have recommendations to get the proper count?

       

      Thanks in advance for your help.

       

      Jeff

        • 1. Re: Sets Not Forming Correctly
          Alexander Mou

          Make up a dummy workbook and upload it if you want it to be solved quickly.

           

          On Tue, May 31, 2016 at 2:06 PM, Jeffrey Jacob <tableaucommunity@tableau.com

          • 2. Re: Sets Not Forming Correctly
            Jeffrey Jacob

            Hi Alexander,

             

            Unfortunately, I am not able to develop a dummy workbook to replicate the issue, and the actual data used has sensitive customer information.  Originally, the problem was contained to the inclusion of customers not satisfying the condition (as described above).  Using a different condition, "_Customers PYTD < 3", Tableau is now EXCLUDING customers which DO satisfy the condition.  Please review the attachment.

             

            Is this a defect?  Where can I report such things?

             

            Unfortunately, I have lost confidence in the use of sets in calculated fields.  Am I missing something?  I truly believe in the power of this software, but certain business metrics are difficult to implement, if not impossible, unless sets are utilized.  However, when sets are not forming correctly, I seem to be running out of valid solutions.

             

            My goal is to identify the number of customers with >= 1 but < 3 transactions PYTD.  I was attempting to first identify each set.  The set >= 1 was formed successfully.  The set < 3 was not.  I was hoping to use a combined set with the overlap of the two sets.

             

            Thanks in advance for your assistance.

             

            Jeff