4 Replies Latest reply on Jun 28, 2016 6:44 PM by Manideep Bhattacharyya

    some basic question -please help

    m jk


      i want to know when we use this formula.


      max(iif([Department]='Furniture',1,0))  =1


      what does this denote , can some one please suggest , if department ='Furniture then 1 else o  ? so what is max   and  =1 

      when do we use this formula  and it evaluates to false when placed on column shelf ?


        • 1. Re: some basic question -please help
          Manideep Bhattacharyya

          Hello - This formula would be very helpful to create a Set of Customers who has bought atleast one single product under the Product Category "Furniture".


          max(iif([Product Category]='Furniture',1,0))  =1


          and then drag the Set to the filter to get only those Customers.

          1 of 1 people found this helpful
          • 2. Re: some basic question -please help
            Rody Zakovich

            I agree with Manideep.


            Essentially this calc could be used in a Set filter to ensure you grab all Customers who made a purchase in Furniture, without filtering the purchases they made in other categories.


            This can be done via sets, or as a LoD (Level of Detail Calculation)


            { FIXED [Customer] : MAX(IF [Category] = 'Furniture' THEN 1 ELSE 0 END) } = 1


            This could be a simple calculated field you can drag onto the filter shelf.


            Let me know if you need additional help on this.




            1 of 1 people found this helpful
            • 3. Re: some basic question -please help
              m jk

              why do we equate to 1 and use max here ?

              • 4. Re: some basic question -please help
                Manideep Bhattacharyya

                Tableau does most of the calculations at row level. Now One Customer can buy Furniture many times in the past, so Against one Customer , the Category Furniture would repeat many times. But what we are really interested in to know whether the Customer has bought a single time any of the Furniture product. So max is between 0 and 1.


                If Customer never bought any Furniture then it would be 0

                If Customer bought at least one time a Furniture Product, then it would be 1


                I would suggest you to close look in the data and create a small data set and try it out by yourself.

                2 of 2 people found this helpful