cancel
Showing results for 
Search instead for 
Did you mean: 
intapiuser
Community Team Member
Community Team Member
Waterfall charts are a beautiful way to show a positive and negative stack in series. This sums to a running total over the series of values. It allows a consumer to quickly see the rise and fall over the series so they can identify the points in the chain causing a large drop. This can also be a great way to display a KPI across another dimension.
  • For the two running total series, color = #f9f9f9
  • Set the negative series to red, a possible color = #fb3a2d
  • Use ord as x-axis, abs and running_total as y-axis, and sign as series
Here's a parameterized snippet to transform the data into a waterfall ready chart:
Title: waterfall_charts(table,value,order)
select
  [order]
  , abs([value])
  , case
    when [value] > 0
      then sum([value]) over(order by [order] rows between unbounded preceding and 1 preceding)
    else [value] + sum([value]) over(order by [order] rows between unbounded preceding and 1 preceding)
  end as running_total
  , case
    when [value] > 0
      then 'positive'
    else 'negative'
  end as sign
from
  [table]
Rate this article:
Version history
Last update:
‎03-02-2023 08:59 AM
Updated by:
Contributors