Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

andyrebs
New Contributor

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

Re: avg lead time with number order dimension in a chart

Maybe something like this:

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


talk is cheap, supply exceeds demand
andyrebs
New Contributor

Re: avg lead time with number order dimension in a chart

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
New Contributor

Re: avg lead time with number order dimension in a chart

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.

Re: avg lead time with number order dimension in a chart

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
New Contributor

Re: avg lead time with number order dimension in a chart

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

Community Browser