Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
andyrebs
Contributor III
Contributor III

avg lead time with number order dimension in a chart

Hi ,

I would make a chart with dimension "N.OrdFor" (Order number supplier) and an expression that shows a "order extimated arrival date" for incoming orders.

I have "OrderDate" in the script

I have "OrderArrivalDate" ( is the date when the order has arrived, obviously if the order has not  arrived yet this field is empty)

I don't have a "Supplier Lead time " field  in the script , but I can extrapolate it with this expression ?

AVG(OrderArrivalDate-OrderDate) only for the orders that has already arrived, for the incoming orders it not works

What should be the correct expression?

(I made this one =DATE(OrderDate+Aggr(Avg(DataCaricoForn-DataOrdForn),RagSocForn),'DD/MM/YYYY')

Many thanks

Andrea

5 Replies
Gysbert_Wassenaar

Maybe something like this:

alt(OrderArivalDate, OrderDate + avg(total <SupplierID> OrderArivalDate-OrderDate))


talk is cheap, supply exceeds demand
andyrebs
Contributor III
Contributor III
Author

Yes, many thanks  Gysbert, the only think is that if i select in the chart an order that has not a OrderArivalDate, the value disappears.

andyrebs
Contributor III
Contributor III
Author

furthermore If i deselect the SupplierId the avg of teh "lead time" change and become the avg of all suppliers not only for the supplyer of the order.

Gysbert_Wassenaar

Ok, try:

alt(OrderArivalDate, OrderDate + avg({<OrderArivalDate= >} total <SupplierID> OrderArivalDate-OrderDate))

And SupplierID should be a dimension in your chart.. or you could replace it with SuplierName or something. But if you want the average per supplier then supplier needs to be a dimension in the chart in some form. Another solution may be possible, but that would get rather complicated.


talk is cheap, supply exceeds demand
andyrebs
Contributor III
Contributor III
Author

Hi Gysbert,

I tryed your further suggestion, but is still not working.

Can I load the "avg lead time" on the script? so that I can use it as normal field.

Please give me some advices.

Best regards

Andrea