New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Freeze when using aggregate in a virtual field #39366
Comments
The solution is to use a
|
What is the point of "TYPE"=attribute(@parent,'TYPE') anyway? IRL I don't see why anyone would compare a field value to itself. |
This can be used for instance to calculate aggreagates on a rolling window (cumulative sum up to the feature for instance). |
Ah you mean when you need to I assume this is caused by the fact that you fix the variable outside of the scope are than check it when evaluating... |
I know the issue is wont_fix, but I am having a very similar issue without even using the |
In my case, the "with_variable" still didnt solve it. In fact, also other functions, such as "count" in a virtual field caused qgis to crash each time I applied the changes. |
We would need the data and expression/project if someone wants to investigate. |
The following is the project file: then in the layer called
and as soon as I apply the changes it fails. If I create a calculated (non-virtual) field, it works fine. I know here i am not using the aggregate function, but I was using the "count" workaround as an option to the following:
(both the |
This issue is still valid on QGIS 3.22.3. (Windows 10) |
Using a layer with 1 feature, the following expression:
aggregate('test','sum',"HECTARES","TYPE"=attribute(@parent,'TYPE'))
using this as a label causes no issue
using it in virtual field leads to a freeze (see the stack trace)
it doesn't seem to be related to the backend (tested with PG and GPKG)
example project and data:
issue-aggregate-virtual.zip
see the expression used in labelling, try to use it as a virtual field
So far, it looks like an infinite recursion in the aggregate as it uses the parent feature.
Stack trace:
The text was updated successfully, but these errors were encountered: