I'm querying a snapshot of customer data that contains the snapshot date, the customer ID and the 'value' of that customer on that day. I use the LAG function to return the previous days value to know if there is a drop/rise/complete loss/complete new value (from £0 to > £0).
The end game is to identify the min and max dates where the customer was at £0 value.
Originally I tried MIN(Date) and Max(Date) grouping by the Customer and Value. …