Query editor
SELECTdate_trunc('month', creation_date) as month,count_if(chain = 'ethereum') as ethereum_per_month,count_if(chain = 'polygon') as polygon_per_month,count_if(chain = 'base') as base_per_month,count_if(chain = 'optimism') as optimism_per_month,count_if(chain = 'arbitrum') as arbitrum_per_month,count_if(chain = 'worldchain') as worldchain_per_month,count_if(chain = 'gnosis') as gnosis_per_month,count_if(chain = 'linea') as linea_per_month,count_if(chain = 'unichain') as unichain_per_month,count_if(chain = 'ink') as ink_per_month,count_if(chain = 'sonic') as sonic_per_month,sum(count_if(chain = 'ethereum')) over (order by date_trunc('month', creation_date)) as ethereum_cumulative,sum(count_if(chain = 'polygon')) over (order by date_trunc('month', creation_date)) as polygon_cumulative,sum(count_if(chain = 'base')) over (order by date_trunc('month', creation_date)) as base_cumulative,sum(count_if(chain = 'optimism')) over (order by date_trunc('month', creation_date)) as optimism_cumulative,sum(count_if(chain = 'arbitrum')) over (order by date_trunc('month', creation_date)) as arbitrum_cumulative,sum(count_if(chain = 'worldchain')) over (order by date_trunc('month', creation_date)) as worldchain_cumulative,sum(count_if(chain = 'gnosis')) over (order by date_trunc('month', creation_date)) as gnosis_cumulative,sum(count_if(chain = 'linea')) over (order by date_trunc('month', creation_date)) as linea_cumulative,sum(count_if(chain = 'unichain')) over (order by date_trunc('month', creation_date)) as unichain_cumulative,sum(count_if(chain = 'ink')) over (order by date_trunc('month', creation_date)) as ink_cumulative,sum(count_if(chain = 'sonic')) over (order by date_trunc('month', creation_date)) as sonic_cumulative,sum(count(*)) over (order by date_trunc('month', creation_date)) as cumulativeFROM query_4171932 -- loans with $ value LLLGROUP BY 1