Example

{% sankey_chart
    data="demo_order_details"
    source="case when category in ('Home', 'Clothing') then 'Home & Clothing' else 'Other' end"
    target="category"
    value="sum(quantity)"
/%}

Attributes

data
String
required
Name of the table to query
filters
Array
default:"[]"
Array of column names to use as filters
date_range
Use date_range to filter data for specific time periods like last 12 months, year-to-date, etcExample:
date_range={
  range = value
  date = "string"
}
Attributes:
  • range: enum
  • date: string
source
String
required
Column name for source nodes
target
String
required
Column name for target nodes
value
String
required
Column name for flow values
percent
String
Column name for percentage values (optional)
title
String
Title to display above the chart
subtitle
String
Subtitle to display below the title
info
String
Information tooltip text (can only be used with title)
value_fmt
String
default:"num"
Format for values
node_labels
String
default:"name"
Node label display
Link label display
node_align
String
default:"justify"
Node alignment
node_gap
Number
default:"10"
Gap between nodes in pixels
node_width
Number
default:"20"
Width of nodes in pixels
orient
String
default:"horizontal"
Orientation
sort
Boolean
default:"false"
Sort nodes by value
Link color mode
outline_color
String
Node outline color
outline_width
Number
default:"0"
Node outline width in pixels
where
String
Custom SQL WHERE condition to apply to the query. For date filters, use date_range instead.
having
String
Custom SQL HAVING condition to apply to the query after GROUP BY
limit
Number
Maximum number of rows to return from the query
order
String
Column name(s) with optional direction (e.g. “column_name”, “column_name desc”)
qualify
String
Custom SQL QUALIFY condition to filter windowed results
width
Number
Set the width of this component (in percent) relative to the page width