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

Defining Fact Tables for Data from SM Specific SQL Queries #12

Open
puru-khedre opened this issue Dec 24, 2024 · 1 comment
Open

Defining Fact Tables for Data from SM Specific SQL Queries #12

puru-khedre opened this issue Dec 24, 2024 · 1 comment
Assignees

Comments

@puru-khedre
Copy link
Collaborator

puru-khedre commented Dec 24, 2024

Needs to define The Fact Tables to store the data generated by the following queries:

  1. Sales by Item Level Query
  2. Return by Item Level Query
  3. Appeasement Query
@puru-khedre
Copy link
Collaborator Author

puru-khedre commented Dec 25, 2024

@dt2patel Below is the required schema based on the SQL query analysis

Returns

OrderItemFulfillmentFact

  • ORDER_ID
  • ORDER_ITEM_SEQ_ID
  • SHOPIFY_ORDER_NAME
  • ORDER_DATE
  • SHIP_DATE
  • CHANNEL
  • ADDRESS
  • CITY
  • STATE
  • ZIP_CODE

ProductDimension

  • PRODUCT_TYPE_ID
  • PRODUCT_ID

Required New fields

  • return_header.RETURN_ID

  • return_header.RETURN_DATE

  • return_header.RETURN_HEADER_TYPE_ID

  • return_header.DESTINATION_FACILITY_ID

  • return_header.RETURN_CHANNEL_ENUM_ID

  • return_item.RETURN_ITEM_SEQ_ID

  • return_item.RETURN_PRICE

  • return_item.STATUS_ID

  • return_item.PRODUCT_ID

  • Shopify_Return_Id

  • RET_PROMO_ADJ 'DISCOUNT' (return_adjustment)

  • RET_TAX_ADJ 'TOTAL_TAX_REFUND' (return_adjustment)

  • return_item.ORDER_ID

  • return_item.ORDER_ITEM_SEQ_ID

  • return_item.PRODUCT_ID

  • order_item.EXTERNAL_ID -- Currently not present in Fulfillment Fact


Appeasments

  • return_header.RETURN_ID
  • return_header.RETURN_DATE
  • return_adjustment.ORDER_ID
  • return_adjustment.RETURN_ADJUSTMENT_TYPE_ID = 'APPEASEMENT'
  • return_adjustment.COMMENTS
  • return_adjustment.DESCRIPTION
  • return_adjustment.AMOUNT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant