Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Am trying to capture an average price for a particular material across all sites. In the past, have used something similar to:
sum(total<Material>Euros/1000)
/
sum(total<Material>QtyKG/1000)
However, I would like to capture the average price for a particular period (and the period view, is defined by the user ie Annual, Quarter, Monthly). For this, I have used a variable. My formula then looks something similar to this:
sum({$<'$(zvarTimePeriod)' = {'$(=minstring($(zvarTimePeriod)))'}>} Euros)
/
sum({$<'$(zvarTimePeriod)' = {'$(=minstring($(zvarTimePeriod)))'}>} QtyKG)
The above works well, and defines an Average Price for earliest selcted period, but this is only at site/material level. I am trying to expand the above, so that it returns an average price across all sites. So technically, all I have to do is add the "Total" and "<Material>" into the above formula - although I am having some issues...
can anyone point me in the right direction please...
Kind regards,
Rich
Hi,
this is the solution:
sum({$<'$(zvarTimePeriod)' = {'$(=minstring($(zvarTimePeriod)))'}>} Total <Material> Euros)
/
sum({$<'$(zvarTimePeriod)' = {'$(=minstring($(zvarTimePeriod)))'}>} Total <Material> QtyKG)
Hi,
this is the solution:
sum({$<'$(zvarTimePeriod)' = {'$(=minstring($(zvarTimePeriod)))'}>} Total <Material> Euros)
/
sum({$<'$(zvarTimePeriod)' = {'$(=minstring($(zvarTimePeriod)))'}>} Total <Material> QtyKG)