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

Decorations: expressions in Title Label #60355

Closed
2 tasks done
pigreco opened this issue Jan 30, 2025 · 4 comments
Closed
2 tasks done

Decorations: expressions in Title Label #60355

pigreco opened this issue Jan 30, 2025 · 4 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Decorations Expressions Related to the QGIS expression engine or specific expression functions

Comments

@pigreco
Copy link
Contributor

pigreco commented Jan 30, 2025

What is the bug or the crash?

In QGIS version 3.22.10 the aggregation expressions in Title Label decoration worked, now in the recent versions 3.34, 3.40 and master they do not work anymore.

here is a demo of QGIS 3.22:
https://x.com/totofiandaca/status/1558714134463762432

the expression used is:

aggregate (
layer:= 'LayerName',
aggregate:= 'count',
expression:= @id,
filter:= intersects (@map_extent, @geometry))

In current versions of QGIS, the expression used in the Title Label always returns 0

Steps to reproduce the issue

  1. start QGIS;
  2. load the point or polygon layer;
  3. From the View | Decorations | Title Label menu, insert the expression using the 'Insert or edit an expression' button

Versions

Versione di QGIS3.40.3-Bratislava
Revisione codice QGIS2a274ab7
 
Librerie
Versione Qt5.15.13
Versione Python3.12.8
Versione GDAL/OGR3.10.1
Versione PROJ9.5.1
Versione database del Registro EPSGv11.022 (2024-11-05)
Versione GEOS3.13.0-CAPI-1.19.0
Versione SQLite3.46.1
Versione PDAL2.8.3
Versione client PostgreSQLunknown
Versione SpatiaLite5.1.0
Versione QWT6.3.0
Versione QScintilla22.14.1
Versione SOWindows 11 Version 2009
 
Plugins Python attivi
DataPlotly4.0.1
kmltools3.1.29
nominatim_locator_filter0.2.4
Qgis2threejs2.7.1
QGIS_FMV1.15
quick_map_services0.19.33
db_manager0.1.20
grassprovider2.12.99
processing2.12.99
MetaSearch0.3.6

Supported QGIS version

  • I'm running a supported QGIS version according to the roadmap.

New profile

Additional context

No response

@pigreco pigreco added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Jan 30, 2025
@agiudiceandrea
Copy link
Contributor

agiudiceandrea commented Jan 30, 2025

@pigreco, I cannot replicate the issue on Windows 10 running QGIS 3.40.3 from OSGeo4W:

Video_2025-01-30_090706.mp4

@agiudiceandrea agiudiceandrea added the Feedback Waiting on the submitter for answers label Jan 30, 2025
@pigreco
Copy link
Contributor Author

pigreco commented Jan 30, 2025

It doesn't always work, with this expression it always returns 0

aggregate(
layer:='World Map',
aggregate:='sum',
expression:= "fid" ,
filter:=is_selected())

Image

@agiudiceandrea
Copy link
Contributor

agiudiceandrea commented Jan 30, 2025

Does the expression mentioned in the issue description works correctly? Does the expression mentioned in the latest comment worked with QGIS 3.22 in the Title Label decoration?
Does this expression works:

aggregate(
layer:='World Map',
aggregate:='sum',
expression:= "fid" ,
filter:= is_selected( 'World Map', @feature ))

@agiudiceandrea agiudiceandrea added Expressions Related to the QGIS expression engine or specific expression functions Decorations and removed Feedback Waiting on the submitter for answers labels Jan 31, 2025
@pigreco
Copy link
Contributor Author

pigreco commented Jan 31, 2025

@agiudiceandrea

Does this expression works:

aggregate(
layer:='World Map',
aggregate:='sum',
expression:= "fid" ,
filter:= is_selected( 'World Map', @feature ))

Yes, this works!
Thanks a lot

Image

@pigreco pigreco closed this as completed Jan 31, 2025
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! Decorations Expressions Related to the QGIS expression engine or specific expression functions
Projects
None yet
Development

No branches or pull requests

2 participants