Skip to content
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

$rownum (and possibly other functions) do not work on virtual fields #27259

Closed
qgib opened this issue Jul 17, 2018 · 3 comments
Closed

$rownum (and possibly other functions) do not work on virtual fields #27259

qgib opened this issue Jul 17, 2018 · 3 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Expressions Related to the QGIS expression engine or specific expression functions

Comments

@qgib
Copy link
Contributor

qgib commented Jul 17, 2018

Author Name: Giovanni Manghi (@gioman)
Original Redmine Issue: 19431
Affected QGIS version: 3.3(master)
Redmine category:field_calculator


It always return "0".

Another example is "count", which returns always NULL.

Tested on LTR and master.

On non virtual fields are ok.

@qgib
Copy link
Contributor Author

qgib commented Jul 17, 2018

Author Name: Luigi Pirelli (@luipir)


confirmed on master an 2.18 LTR

@qgib
Copy link
Contributor Author

qgib commented Jul 17, 2018

Author Name: Luigi Pirelli (@luipir)


rownumber is filled here
https://github.com/qgis/QGIS/blob/master/src/app/qgsfieldcalculator.cpp#L274

but completly skipped here
https://github.com/qgis/QGIS/blob/master/src/app/qgsfieldcalculator.cpp#L197 in case of virtualfields

probably a simple if reorganization would solve... investigating more

@qgib
Copy link
Contributor Author

qgib commented Jul 20, 2018

Author Name: Nyall Dawson (@nyalldawson)


It's deliberately not exposed here, because it has no meaning outside of the field calculator (since virtual fields are "global" for a layer, yet the layer may be opened in two different attribute table dialogs both with different sort orders). Use $id instead.


  • resolution was changed from to wontfix
  • status_id was changed from Open to Closed

@qgib qgib closed this as completed Jul 20, 2018
@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! Expressions Related to the QGIS expression engine or specific expression functions labels May 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Expressions Related to the QGIS expression engine or specific expression functions
Projects
None yet
Development

No branches or pull requests

1 participant