Created
December 11, 2017 05:32
Star
You must be signed in to star a gist
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