View: Return Lines

This article will help you learn about the fields available in the Return Lines view, the field types, descriptions and how the fields are calculated

Key Topics

Click on the links below to take you to the section where you can learn more about this View and where it is used and how it is created

View Definition

This view is linked to the [drp.loop_return_lines] table which generated as part of the Daasity transformation process and has the following fields available/visible for use.

 

Field Name Field Type Description Source / Calculation
Shopify Line Item ID Dimension The ID for the Line in Shopify that was returned shopify_line_item_id
Shopify Product ID Dimension The Product ID from Shopify shopify_product_id
Shopify Variant ID Dimension The ID of the Product Variant in Shopify shopify_variant_id
Parent Return Reason Dimension The first level reason why the product was returned parent_return_reason
Return Reason Dimension The second level (detail) reason the product was returned return_reason
SKU Dimension The SKU that was returned sku
Variant Name Dimension The name of the variant that was returned title
Return - Discount Amount Measure The discount amount that was part of the return COALESCE(SUM(discount ), 0)
Return - Product Amount Measure The product amount that was returned COALESCE(SUM(price), 0)
Return - Refund Amount Measure The total amount refunded COALESCE(SUM(refund), 0)
Return - Tax Amount Measure The tax amount that was returned COALESCE(SUM(tax), 0)
Return - Total Amount Measure The total amount of the return which is the Product Returned + Tax Returned - Discount Returned COALESCE(SUM(price + tax - discount), 0)
Return Rate Measure The total items returned / the number of valid items in the original order 1.00 * COALESCE(SUM(quantity ), 0) / NULLIF(COALESCE(SUM(CASE WHEN order_line_revenue.valid_order_flag_daasity = TRUE THEN order_line_revenue.num_feature_items ELSE 0 END ), 0), 0)
Total Items Returned Measure The total number of items (products) that were returned COUNT(DISTINCT(return_line_id))
Total Units Returned Measure The total numbers of units returned COALESCE(SUM(quantity ), 0)

Explores

This view is part of the following explores:

  • Loop Returns

Transformation Code

This view is a Daasity derived table generated by the following code:

  • [4330_RET_BAS_loop_return_lines.sql]