4 Replies Latest reply on Aug 26, 2014 2:30 AM by andrewvincent.yap

    How to make histograms for complex table calculations?


      Hi all,


      I've been trying to find a discussion on making histograms for calculated fields with complex table calculations (i.e. values of the fields are dependent on the presence of other grouping fields). Unfortunately, most discussions are about histograms of calculated fields that do not require table calculations.


      My problem:


      I was able to create a table that looks like this in Tableau:

      The Days Diff field has the following formula:

           IF INDEX() > 1

                THEN DATEDIFF('day', LOOKUP(MAX([Date]),-1), MAX([Date]))



      and uses the following table calculation:

      Note: [Index] = INDEX()

      I want to make a histogram of the Days Diff field. I will be using this for a dashboard that filters by product and customer name. If, for example, I select Product Name = Awesome Product and Customer Name = Jane Doe, then the histogram for the values (6, 5, 2, 5, 7) should appear.


      Unfortunately, I cannot obtain values for Days Diff unless I create the table above. This prevents me from creating a histogram because of the presence of the Product Name, Customer Name, and Date fields.


      Is there any workaround for this without having to export data? Any help will be appreciated.