2 Replies Latest reply: Feb 17, 2012 5:41 AM by Przemek K RSS

    Advanced aggregation problem

    Gora Costa Sanz

      Hi, If you check the attached file you will see a table with 375 records.I need to know how many of this are distinct based on the first field, but only the first 10 characters, and from those, just the ones that ShIppment SHipped field is different from 0.I've made several tests and this is the best I can come with :

       

      aggr(distinct count(if(Shipment_Shipped=0,0,left(Shipment_Order_ShipId_Line,10))),Key_Date)

       

       

      but this gives me again the 375 records.I'm not sure what to do now, Any ideas? thanks in advance to anyone who can help me...

        • Advanced aggregation problem
          Celambarasan Adhimulam

          Hi

               Instead of doing this in expresssion try to make a separate field

               Load

                    Shipment_Order_ShipId_Line,

                    Left(Shipment_Order_ShipId_Line,10) as Shippment_Order,

                    Shipment_Shipped

               From DataFile;

           

          Then use expression as Count({<Shipment_Shipped={0}>} Distinct Shippment_Order)

           

          It will give you the correct result

           

          Celambarasan