Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
We want to calculate count of each distinct Parcle number whoes order date is max for.
In above table the Total count should be 3.
In bar chart dimension will be Product name and measure should be count ( distinct Parcel number)
Kindly advise
Hi, if possible t would be easier and give better performance if you add a flag to the max record in script, just do a sorted load by [PArcel Number] and [Order Date] desc, and use peek() to set the flag to 1 when [Parcel Number]<>Peek([Parcel Number])
With this the expression could be a simple: Sum(flagField)
Without it you can use aggr() like:
Sum(Aggr(If([Order Date]=Max(TOTAL <[Parcel Number]> [Order Date]),1,0),[Parcel Number],[Product Name]))
Hi Rub,
Thanks for the response but below expression is not returning the result.
Sum(Aggr(If([Order Date]=Max(TOTAL <[Parcel Number]> [Order Date]),1,0),[Parcel Number],[Product Name]))
Just Use a Calculated dimension for OrderDate
= if(OrderDate = aggr(Max(OrderDate),ParcelNumber),OrderDate,null()). <--- uncheck show null values for this dimension
Hi, I did a test and it worked for me, in table and in KPI.
You can upload a sample to check what is different.