{"action":"created","issue":{"url":"https://api.github.com/repos/michaelwhiteha/Testing/issues/9","repository_url":"https://api.github.com/repos/michaelwhiteha/Testing","labels_url":"https://api.github.com/repos/michaelwhiteha/Testing/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/michaelwhiteha/Testing/issues/9/comments","events_url":"https://api.github.com/repos/michaelwhiteha/Testing/issues/9/events","html_url":"https://github.com/michaelwhiteha/Testing/issues/9","id":300723130,"number":9,"title":"Transaction Count - Mismatch Amounts","user":{"login":"michaelwhiteha","id":25435784,"avatar_url":"https://avatars1.githubusercontent.com/u/25435784?v=4","gravatar_id":"","url":"https://api.github.com/users/michaelwhiteha","html_url":"https://github.com/michaelwhiteha","followers_url":"https://api.github.com/users/michaelwhiteha/followers","following_url":"https://api.github.com/users/michaelwhiteha/following{/other_user}","gists_url":"https://api.github.com/users/michaelwhiteha/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelwhiteha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelwhiteha/subscriptions","organizations_url":"https://api.github.com/users/michaelwhiteha/orgs","repos_url":"https://api.github.com/users/michaelwhiteha/repos","events_url":"https://api.github.com/users/michaelwhiteha/events{/privacy}","received_events_url":"https://api.github.com/users/michaelwhiteha/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"lekvan","id":23304728,"avatar_url":"https://avatars3.githubusercontent.com/u/23304728?v=4","gravatar_id":"","url":"https://api.github.com/users/lekvan","html_url":"https://github.com/lekvan","followers_url":"https://api.github.com/users/lekvan/followers","following_url":"https://api.github.com/users/lekvan/following{/other_user}","gists_url":"https://api.github.com/users/lekvan/gists{/gist_id}","starred_url":"https://api.github.com/users/lekvan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lekvan/subscriptions","organizations_url":"https://api.github.com/users/lekvan/orgs","repos_url":"https://api.github.com/users/lekvan/repos","events_url":"https://api.github.com/users/lekvan/events{/privacy}","received_events_url":"https://api.github.com/users/lekvan/received_events","type":"User","site_admin":false},"assignees":[{"login":"lekvan","id":23304728,"avatar_url":"https://avatars3.githubusercontent.com/u/23304728?v=4","gravatar_id":"","url":"https://api.github.com/users/lekvan","html_url":"https://github.com/lekvan","followers_url":"https://api.github.com/users/lekvan/followers","following_url":"https://api.github.com/users/lekvan/following{/other_user}","gists_url":"https://api.github.com/users/lekvan/gists{/gist_id}","starred_url":"https://api.github.com/users/lekvan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lekvan/subscriptions","organizations_url":"https://api.github.com/users/lekvan/orgs","repos_url":"https://api.github.com/users/lekvan/repos","events_url":"https://api.github.com/users/lekvan/events{/privacy}","received_events_url":"https://api.github.com/users/lekvan/received_events","type":"User","site_admin":false}],"milestone":null,"comments":0,"created_at":"2018-02-27T17:28:08Z","updated_at":"2018-02-27T18:22:40Z","closed_at":null,"author_association":"OWNER","body":"CouponId: 111356\r\n\r\nSQL: 24675\r\nPowerBI: 24674\r\n\r\n```\r\nDECLARE @DateStart date = '2017-06-01'\r\nDECLARE @DateEnd date = '2017-06-30'\r\nDECLARE @CouponId int = 111356;\r\n\r\n\r\nWITH AdditionalSpendNet as (                   \r\nSELECT TransactionId                           \r\n,sum(case when A.CouponId <> @CouponId or A.CouponId IS NULL then A.Quantity else 0 end)   AS AdditionalSpendNetQuantity                          \r\n,sum(case when A.CouponId <> @CouponId or A.CouponId IS NULL then A.Sales else 0 end)      AS AdditionalSpendNetSales                 \r\nFROM Edw_dev.Pub.FactCouponRedeemsDEV A                 \r\nWHERE 1=1                 \r\nAND A.TransactionDate between @DateStart and @DateEnd                     \r\nAND A.Transactionid IN (Select DISTINCT CP.Transactionid FROM Edw_dev.Pub.FactCouponRedeemsDEV CP WHERE CP.CouponId = @Couponid and PromoId is not null)                    \r\nGROUP BY A.TransactionId            )\r\n\r\nSELECT \r\n\r\nCount(Distinct Ad.TransactionId)                                 AS 'Transaction Count'    \r\n\r\nFROM Edw_dev.Pub.FactCouponRedeemsDEV F                                                                                                                    \r\nLEFT JOIN AdditionalSpendNet         Ad  on F.TransactionId = Ad.TransactionId \r\nWHERE 1=1  \r\nAND F.TransactionDate between @DateStart and @DateEnd  \r\nAND F.Transactionid IN (Select DISTINCT CP.Transactionid FROM Edw_dev.Pub.FactCouponRedeemsDEV CP WHERE CP.CouponId = @Couponid and PromoId is not null)\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/michaelwhiteha/Testing/issues/comments/368976295","html_url":"https://github.com/michaelwhiteha/Testing/issues/9#issuecomment-368976295","issue_url":"https://api.github.com/repos/michaelwhiteha/Testing/issues/9","id":368976295,"user":{"login":"lekvan","id":23304728,"avatar_url":"https://avatars3.githubusercontent.com/u/23304728?v=4","gravatar_id":"","url":"https://api.github.com/users/lekvan","html_url":"https://github.com/lekvan","followers_url":"https://api.github.com/users/lekvan/followers","following_url":"https://api.github.com/users/lekvan/following{/other_user}","gists_url":"https://api.github.com/users/lekvan/gists{/gist_id}","starred_url":"https://api.github.com/users/lekvan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lekvan/subscriptions","organizations_url":"https://api.github.com/users/lekvan/orgs","repos_url":"https://api.github.com/users/lekvan/repos","events_url":"https://api.github.com/users/lekvan/events{/privacy}","received_events_url":"https://api.github.com/users/lekvan/received_events","type":"User","site_admin":false},"created_at":"2018-02-27T18:22:40Z","updated_at":"2018-02-27T18:22:40Z","author_association":"COLLABORATOR","body":"Updated the table properties for transactionfact table to point at Edw_dev instead of edw. Matches on my end now"}}
{"actor":{"display_login":"lekvan"}}