10 Replies Latest reply on Apr 20, 2017 10:11 AM by Justin Larson

    Count No of Records within each Partition

    mike.dale

      Hi All,

       

      I am trying to calculate the number of records within each partition. I thought it would be a simple LOD calculation however for some reason I just can't get this to work.

       

      My table looks something like this:

       

      CarIdPurchase_Date
      C12301/02/2017
      04/02/2017
      02/03/2017
      01/03/2017
      04/03/2017
      04/02/2017
      04/02/2017
      C32302/03/2017
      C43204/03/2017
      02/03/2017
      10/03/2017
      12/03/2017
      14/03/2017
      C45304/02/2017
      12/03/2017
      04/03/2017

       

      The LOD I put together looks like this: {INCLUDE [CarId],[Purchase_Date]: COUNTD([Purchase_Date])} .  But this isn't working. I need it to return the number of rows in each partition e.g.:

      C123 = 7

      C323 = 1

      C4342 = 6

      C453 = 3

       

      Then I need to use this as a filter and exclude values below 5. So CarId C323 and C453 should be filtered out as they have less than 5 records each.

       

      Would much appreciate any help.

       

      Hope it make sense.

       

      Thanks