-
Notifications
You must be signed in to change notification settings - Fork 22
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
[Feature] add staging for discount_allocation #73
Comments
Hey @AaronHagan4, thanks for reaching out about this feature and we are glad you are interested in contributing to our Shopify package! If I'm understanding this correctly, it seems that you are primarily looking to have the index field (which I believe you reference as line_item_discount) from the discount_allocation table included in the shopify__order_lines output model. Additionally, you are looking for a discount_allocation staging model that you can reference to bring into the shopify__order_lines output model. I would need to double check Stripe's relationship between discount allocation and order line items, but it seems that there may be multiple types of discount allocations that can be applied to one order line item. It seems that in the shopify__orders__order_line_aggregates model, we actually aggregate the discount amount from the order_lines tables rather than the discount_allocation table. We will begin investigating this relationship. So we can better understand the purpose behind your request, do you mind elaborating on why you are looking to add the line_item_discount field to the shopify__order_lines output model and any nuances regarding the discount_allocation table relative to the total_discount field in the order_lines table? |
hey @elanfivetran, thanks for the reply! In our shop, total_discounts in the line_item table do not provide accurate discounts. The main reason we want to add the discount_allocation staging model is because this total_discounts column does not match our shopify user interface for line_items. I'm not 100% sure why this is but i think it might be because discounts can be applied at different levels. we pull the order_line discount from the discounts_allocation table;
i dont think I'm the first to run into this issue from reading the dbt slack community; I've been unable to find documentation on how line item discount is calculated but please do share if you do! |
+1 on this. Line item discounts are important to understanding product revenues. Shopify provides a valuable service in that it takes order level discounts and allocates to line items. The source table Shopify recommends using it as well. Within the
and it's recommended to use
I think that's what @AaronHagan4 was getting at. I think it's still an issue. |
Is there an existing feature request for this?
Describe the Feature
Our company uses the discount_allocation table for calculating line_item_discount and having these tables staged in this package would be really helpful. I am willing to open a PR for it if someone is willing to review it? I would also then be willing to add line_item_discount into the shopify__order_lines model in the dbt-shopify package if that is something of interest.
Describe alternatives you've considered
No response
Are you interested in contributing this feature?
Anything else?
No response
The text was updated successfully, but these errors were encountered: