Loading files
710fbeaaeThis file is pinned to the selected release. Download the original to open it in your design tool.
Files from this revision, including CAD and LFS contents. Git history is not included.
Or in GitHub Desktop, choose File → Clone repository → URL and paste this address.
Public repositories can be cloned without signing in. For pushing, use your ThingAtlas username and a Git access token as the password.
git lfs install git clone https://thingatlas.com/git/-unclaimed/openharness-1322671404.git
Includes Git history, branches, and Git LFS files. Clones the repository’s default branch, regardless of the version shown here.
WITH signed_lines AS (
SELECT CASE WHEN substr(sold_on,1,7)=substr(:comparison,1,7) THEN 1 ELSE -1 END
* (quantity*unit_price_cents-discount_cents-refund_cents) AS delta, product_id
FROM transactions
WHERE status='completed' AND (:region='' OR region=:region)
AND substr(sold_on,1,7) IN (substr(:baseline,1,7),substr(:comparison,1,7))
), by_category AS (
SELECT p.category,sum(s.delta) AS delta FROM signed_lines s JOIN products p ON p.product_id=s.product_id GROUP BY p.category
)
SELECT CASE WHEN coalesce((SELECT sum(delta) FROM signed_lines),0)
=coalesce((SELECT sum(delta) FROM by_category),0) THEN 0 ELSE 1 END AS violations;
710fbeaaeThis file is pinned to the selected release. Download the original to open it in your design tool.