2 Replies Latest reply on Dec 8, 2016 6:37 AM by David Poustilnik

    Number of Records

    David Poustilnik

      Hi,

       

      I'm trying to differentiate btw above or below limits (5,000) on the Number of records.

       

      Below is the an example of number of records derived based the aggregation of data.

       

      Here is my formula, to differientate above or below limits

       

      IF [Number of Records] >= 5000

      THEN 'Above'

      ELSE 'Below'

      END

       

      I then add it to the Color Mark, but only the "Below" appears, but you can clearly see that I have bars that have more than 5,000 transactions.

       

       

      The same formula works for other Measures....is not working because Number of Records is a Tableau calculated measures??

        • 1. Re: Number of Records
          Simon Runc

          hi David,

           

          If you look in the "number of measures" field, you can see it's just the number 1...so when it is SUMed (as its aggregate) it is the number of records...

           

          You're current test is a row level one (in that there is no aggregate)...so Tableau is doing is 1>=5000 on every row, and returning that they are not!

           

          if you wrap it in a SUM it will do what you want, so...

           

          IF SUM([Number of Records]) >= 5000

          THEN 'Above'

          ELSE 'Below'

          END

           

          Although if each bar (in your example) is >5000 will depend on the VizLoD. You might find this useful, on the different types of calculation in Tableau (and how to think of them)

           

          Answer - Quora

           

          Hope that helps, but let me know if that doesn't make sense.

          1 of 1 people found this helpful
          • 2. Re: Number of Records
            David Poustilnik

            Thank You Simon!!