Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reassert uniqueness by pin and doc_no in default.vw_pin_sale #662

Open
wrridgeway opened this issue Dec 4, 2024 · 0 comments
Open

Reassert uniqueness by pin and doc_no in default.vw_pin_sale #662

wrridgeway opened this issue Dec 4, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@wrridgeway
Copy link
Member

wrridgeway commented Dec 4, 2024

default.vw_pin_sale is supposed to be unique by pin and doc_no when mutisales are included and by doc_no when they are not. This still holds true when multisales are excluded, but no longer seems to be the case when they're included. I'm not sure when this became the case since many of the sales in question are from over a decade ago.

This issue is propegating from iasworld.sales. We can see that

select
    parid as pin,
    instruno as doc_no,
    price as sale_price,
    saledt as sale_date
from iasworld.sales
where instruno = '1202334001'
    and cur = 'Y'
    and deactivat is NULL

yields four rows spread over two different dates, all with the same price and doc_no, across two pins. This shows up in default.vw_pin_sale, which shouldn't be the case - we should only get two rows here, one for each pin for a sale on 1/1/2011.

pin doc_no sale_price sale_date
04324020170000 1202334001 2500000 12/1/2011
04324020170000 1202334001 2500000 1/1/2011
04324020240000 1202334001 2500000 1/1/2011
04324020240000 1202334001 2500000 12/1/2011
@wrridgeway wrridgeway added the bug Something isn't working label Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant