<div dir="ltr">Thank you DelazJ, it is working well!<div>there was a "," instead of AND condition!!!</div><div><br>Just a bit slow but it is working well!<div><br></div><div><div><br></div><div>I appreciate</div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Il giorno gio 3 giu 2021 alle ore 17:00 DelazJ <<a href="mailto:delazj@gmail.com">delazj@gmail.com</a>> ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi Dario,</div><div>You want two filters: a field not being null and features being visible. But none of your expressions indicates that.</div><div>Naming parameters could help you avoid falling in this trap (read the tip just above <a href="https://docs.qgis.org/3.16/en/docs/user_manual/working_with_vector/expression.html#some-use-cases-of-expressions" target="_blank">this section</a> in the docs)<br></div><div>try with</div><div>aggregate( <i>'LAYERID</i>','count',"<i>KEY-FIELD</i>","<i>SPECIFIC-FIELD</i>" is not null <b>AND</b> intersects($geometry,map_get(item_variables('Mappa1'),'map_extent')))</div><div><br></div><div>Hope that helps,</div><div>Harrissou<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le jeu. 3 juin 2021 à 11:38, Dario C <<a href="mailto:dario955i@gmail.com" target="_blank">dario955i@gmail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Sorry, I don't want to spam anybody. I send again my request, just in case it never has never sent.</div><div class="gmail_attr">Thank you</div><br><br><div dir="ltr">Hi,<div>I'm trying to have a legend on my layout and I'd like to count the item shown in the legend which are inside the map extent.</div><div><br></div><div>I'm using this expression but:</div><div>case 1) it gives me the total amount of the items (not filtered by map)</div><div>case 2) it gives me the total amount of the items shown in the map, but not filtered by field</div><div><br></div><div><br></div><div>case 1:</div><div><p style="margin:0px;white-space:pre-wrap">aggregate( <i>'LAYERID</i>','count',"<i>KEY-FIELD</i>","<i>SPECIFIC-FIELD</i>" is not null, intersects($geometry,map_get(item_variables('Mappa1'),'map_extent')))</p><p style="margin:0px;white-space:pre-wrap">result: 1965 (the same of the total *"SPECIFIC-FIELD" is not null* in the project (not in the map)

</p><p style="margin:0px;white-space:pre-wrap"><br></p><p style="margin:0px;white-space:pre-wrap">case 2</p><p style="margin:0px;white-space:pre-wrap">aggregate( '<i>LAYERID</i>','count',"<i>SPECIFIC-FIELD</i>" is not null, intersects($geometry,map_get(item_variables('Mappa1'),'map_extent')))<br></p><p style="margin:0px;white-space:pre-wrap">result: 583 (total amount of the items in the map, but not of that specific category)</p><p style="margin:0px;white-space:pre-wrap"><br></p><p style="margin:0px;white-space:pre-wrap">Difference between Case 1 and Case 2 is that case 2 has not "filtered by" values in the formula.</p><p style="margin:0px;white-space:pre-wrap"><br></p><p style="margin:0px;white-space:pre-wrap">Thank you for your support.</p><p style="margin:0px;white-space:pre-wrap"><br></p><p style="margin:0px;white-space:pre-wrap">Cheers</p></div></div>
</div></div>
_______________________________________________<br>
Qgis-user mailing list<br>
<a href="mailto:Qgis-user@lists.osgeo.org" target="_blank">Qgis-user@lists.osgeo.org</a><br>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
</blockquote></div>
</blockquote></div>