django-clickhouse-backend icon indicating copy to clipboard operation
django-clickhouse-backend copied to clipboard

Window func not working

Open PavelIgin opened this issue 1 year ago • 2 comments

i want user this code but Window() func not working exclude_next = Q(value=F('next_value')) | Q(value=F('second_next_value')) exclude_prev = Q(value=F('prev_value')) | Q(value=F('second_prev_value')) queryset = ValueChart.objects.filter(signal=signal.id, date_time__range=( validated_data.get('date_time_before', None), validated_data.get('date_time_after', None)) ).annotate(next_value=Window( expression=Lead('value')), second_next_value=Window( expression=Lead('value', 2)), prev_value=Window(Lag('value')), second_prev_value=Window(Lag('value', 2)) ).order_by('date_time').exclude(exclude_next, exclude_prev ).annotate(x=F('date_time'), y=F('value')).order_by( 'date_time').values('x','y')

PavelIgin avatar Jan 14 '24 06:01 PavelIgin

more details needed, please follow the bug template and open a new issue .

jayvynl avatar Jan 23 '24 00:01 jayvynl

django raised NotSupportedError: This backend does not support window expressions.

MidTin avatar Mar 29 '24 15:03 MidTin