<html><head></head><body><div class="ydpaf6863d5yahoo-style-wrap" style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:13px;"><div></div>
        <div dir="ltr" data-setdir="false">Hi Graeme,</div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false">I think this may be a bug, it appears that this worked at some point, <br></div><div dir="ltr" data-setdir="false"><a href="https://gis.stackexchange.com/questions/222625/qgis-relation-aggregate-how-does-this-work#238265" rel="nofollow" target="_blank">https://gis.stackexchange.com/questions/222625/qgis-relation-aggregate-how-does-this-work#238265</a></div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false">The QEP referenced above is still open:<br></div><div dir="ltr" data-setdir="false"><a href="https://github.com/qgis/QGIS-Enhancement-Proposals/issues/59" class="ydp38ea93abenhancr_card_9740532502" rel="nofollow" target="_blank">QEP 59: Aggregate functions for QGIS expressions · Issue #59 · qgis/QGIS-Enhancement-Proposals</a></div><div><br></div><div dir="ltr" data-setdir="false">but it may not be working anymore?</div><div dir="ltr" data-setdir="false"><a href="https://github.com/qgis/QGIS/issues/29115" rel="nofollow" target="_blank">https://github.com/qgis/QGIS/issues/29115</a></div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false">I tried dumping the expression results to a field in field calculator. I am able to get output only by referencing field names that are common in both the 1 and the many table, for example using the relation between Canadian Provinces and Regional Districts, only the province UID gives anything besides NULL:<br></div><div dir="ltr" data-setdir="false"><span>relation_aggregate('RDs_in_Provinces','concatenate',"PRUID")</span><br></div><div><br></div><div dir="ltr" data-setdir="false">-Thayer<br></div><div><br></div><div><br></div>
        
        </div><div id="ydpb06fcadeyahoo_quoted_0162803719" class="ydpb06fcadeyahoo_quoted">
            <div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;">
                
                <div>
                    On Wednesday, April 6, 2022, 07:40:08 AM EDT, qgis-user-request@lists.osgeo.org <qgis-user-request@lists.osgeo.org> wrote:
                </div>
                <div><br></div><div>> PUBLIC<br><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr">> Hello,<br></div><div dir="ltr"><br></div><div dir="ltr">> I am having issues getting relate_aggregate to do anything within expression builder. Ideally, I would like a features (1) to (m) attributes table setup correctly with a relationship to allow a user to select attributes based on attribute criteria have the corresponding related features selected / shown on map as related. Given how little I am uncovering online about ways to do this, it might not be possible, but even getting the expression builder to update a field in my features with a count of corresponding values in attributes is not updating feature's values, I am wondering if I am doing something wrong. Should this work?<br></div><div dir="ltr"><br></div><div dir="ltr">> Within select by attributes for the feature table:<br></div><div dir="ltr">> relation_aggregate( 'relation _ID','count',1) > 3<br></div><div dir="ltr"><br></div><div dir="ltr">> The preview of the expression returns a value for a feature (without the >3 at end), but when I try to calculate a field of this count - every value returns NULL. With the >3 it does not work at all to select anything.<br></div><div dir="ltr"><br></div><div dir="ltr">> It does look like 'relation_aggregate( 'relation _ID','count',1)' is fine for the basis of evaluating a field of values based on preview but it returns null on running the field calculator.<br></div><div dir="ltr"><br></div><div dir="ltr">> I am using QGIS 3.16<br></div><div dir="ltr"><br></div><div dir="ltr">> Regards,<br></div><div dir="ltr">> Graeme<br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr">> PUBLIC<br></div><br></div>
            </div>
        </div></body></html>