Skip to content

Instantly share code, notes, and snippets.

{
"reports": [
{
"id": "top_customers",
"label": "Top customers",
"report_title": "Sales by Customer",
"variations": [
{
"id": "top_customers__revenue",
"metric_id": "revenue",
<table width="100%" cellpadding="0" cellspacing="0" style="font-family: Arial, sans-serif; color: #222; line-height: 1.6; max-width: 600px; margin: auto;">
<tr>
<td style="padding: 32px 24px;">
<h1 style="color: #19752c; margin-bottom: 8px;">mipler</h1>
<p>Hi Oleksandr 👋</p>
<p>Shopify’s default reports are a good starting point. <br>
You get your revenue, orders, traffic… <br>
But when you want to dig deeper — things get tricky.</p>
{
"tables": [
{
"lineageID": "0b157755-1ac9-3457-97af-2535c3a3ca2c",
"columns": [
{
"lineageID": "1d2c1fd4-4185-4691-8657-323753d925c2",
"name": "hs_code",
"kind": "dimension",
"dataType": "string",
{
"tables": [
{
"lineageID": "0b157755-1ac9-3457-97af-2535c3a3ca2c",
"columns": [
{
"lineageID": "1d2c1fd4-4185-4691-8657-323753d925c2",
"name": "hs_code",
"kind": "dimension",
"dataType": "string",
case(
or(
products.name = "1 POUND BAKED SWEET POTATO FRIES",
products.name = "1 POUND GRILLED BARBECUE CHICKEN BREAST",
products.name = "1 POUND GRILLED FAJITA CHICKEN",
products.name = "1 POUND GRILLED ITALIAN CHICKEN BREAST",
products.name = "1 POUND GRILLED MEDITERRANEAN CHICKEN BREAST",
products.name = "1 POUND OLIVE OIL GARLIC BROCCOLI",
products.name = "1 POUND PLAIN JANE GRILLED CHICKEN BREAST",
products.name = "1 POUND PULLED CHICKEN",
case(
or(
order_items.product_name = "1 POUND BAKED SWEET POTATO FRIES",
order_items.product_name = "1 POUND GRILLED BARBECUE CHICKEN BREAST",
order_items.product_name = "1 POUND GRILLED FAJITA CHICKEN",
order_items.product_name = "1 POUND GRILLED ITALIAN CHICKEN BREAST",
order_items.product_name = "1 POUND GRILLED MEDITERRANEAN CHICKEN BREAST",
order_items.product_name = "1 POUND OLIVE OIL GARLIC BROCCOLI",
order_items.product_name = "1 POUND PLAIN JANE GRILLED CHICKEN BREAST",
order_items.product_name = "1 POUND PULLED CHICKEN",
@NazarenkoDenis
NazarenkoDenis / schema.json
Created January 3, 2025 11:55
schema.json
{
"explores": [
{
"lineageID": "1fe426dd-c1f3-3d7c-af6b-22b233fa9aa4",
"relationships": [
{
"lineageID": "dea0031f-5c51-40e4-808d-02cdeb8b378f",
"isRemoved": true
},
{
{
"explores": [
{
"lineageID": "e57e9c44-7261-434d-8da9-e75f2ea27efd",
"name": "payouts_upd",
"label": "",
"relationships": [
{
"lineageID": "b58301d2-adfa-4397-861c-f73563f89134",
"from": "fulfillment_items.fulfillment_id",
case(
or(
order_items.product_name = "1 POUND BAKED SWEET POTATO FRIES",
order_items.product_name = "1 POUND GRILLED BARBECUE CHICKEN BREAST",
order_items.product_name = "1 POUND GRILLED FAJITA CHICKEN",
order_items.product_name = "1 POUND GRILLED ITALIAN CHICKEN BREAST",
order_items.product_name = "1 POUND GRILLED MEDITERRANEAN CHICKEN BREAST",
order_items.product_name = "1 POUND OLIVE OIL GARLIC BROCCOLI",
order_items.product_name = "1 POUND PLAIN JANE GRILLED CHICKEN BREAST",
order_items.product_name = "1 POUND PULLED CHICKEN",
VAR l_from_variant_name = convert(regexp_match(order_items.variant_name, '\d{2,4}'), INT)
VAR l_from_props = convert(case(
not(is_empty(json_path(order_items.properties, "#(name=""Custom Length"").value"))), json_path(order_items.properties, "#(name=""Custom Length"").value"),
not(is_empty(json_path(order_items.properties, "#(name=""Wunschlänge"").value"))), json_path(order_items.properties, "#(name=""Wunschlänge"").value"),
not(is_empty(json_path(order_items.properties, "#(name=""Longueur sur mesure"").value"))), json_path(order_items.properties, "#(name=""Longueur sur mesure"").value"),
not(is_empty(json_path(order_items.properties, "#(name=""Aangepaste lengte"").value"))), json_path(order_items.properties, "#(name=""Aangepaste lengte"").value"),
not(is_empty(json_path(order_items.properties, "#(name=""Expédié après"").value"))), json_path(order_items.properties, "#(name=""Expédié après"").value"),
not(is_empty(json_path(order_items.properties, "#(name=""Anpassad längd"").value"))), json_path(orde