8 Replies Latest reply: Aug 4, 2017 1:41 PM by Sasidhar Parupudi RSS

    Set Analysis

    Ozgur Cirak

      Hello

       

      I have a table with + million rows. Here is a brief example of table :

       

              

      YearMonthYearNbrMonthNbrPDLLocationIdProductIdStockOnHandStockOnOrderSafetyStockLevelMaxStockLevel
      2015120151108420151285128510844201232
      2015112015117892015111860186789590749
      2015920159105620159200220010562801218
      2015820158151120158215121515114001830
      20153201531069201534814810695703647
      2015720157669201571151115669280518
      20159201593992015913801383992801218

       

      My aim is to count unique product id which has overstock value as StockOnHand is greater than MaxStockLevel

       

      I can do this with if formula like : count(distinct(if(StockOnHand>MaxStockLevel, ProductId)))

       

      But i want to calculate this as a set analysis.

       

      Is it achievable?