Created
December 11, 2017 05:32
-
-
Save agawronski/6813a4a31a3c879a0e5569e0c1f232f8 to your computer and use it in GitHub Desktop.
Get some basic metrics on the purchaseorderdetail table.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- what is APT, and UPT, APU | |
-- average per transaction | |
-- units per transaction | |
-- average per unit | |
select | |
(sum(orderqty * unitprice)/count(distinct purchaseorderid)) as apt, | |
(sum(orderqty)/count(distinct purchaseorderid)) as upt, | |
(sum(orderqty * unitprice)/sum(orderqty)) as apu | |
from purchasing.purchaseorderdetail; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment