Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Advanced aggregation problem

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...

2 Replies
CELAMBARASAN
Partner - Champion
Partner - Champion

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

Not applicable
Author

Hi,

I think Celambarasan's solution is a good one.

As you want result for ShipmentShipped different from 0, I believe the expression should be

Count({<Shipment_Shipped-={0}>} Distinct Shippment_Order)

kind regards