<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Vorformatiert Zchn";
        margin:0cm;
        font-size:10.0pt;
        font-family:"Courier New";
        mso-fareast-language:DE;}
span.HTMLVorformatiertZchn
        {mso-style-name:"HTML Vorformatiert Zchn";
        mso-style-priority:99;
        mso-style-link:"HTML Vorformatiert";
        font-family:Consolas;
        mso-fareast-language:EN-US;}
span.E-MailFormatvorlage22
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=DE link=blue vlink=purple style='word-wrap:break-word'><div class=WordSection1><p class=MsoNormal>Hi Nicolas,<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span lang=EN-GB>thank you for your quick reply. I am not sure if I understand correctly what you are suggesting, because the ‘join by attribute’ and ‘aggregate’ functions both will change the attributes of the vector layer. <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB>What I´m trying to do instead is to give a list of field names as a parameter to the function ‘statistics by categories’, and my problem is that I don´t have this single list, but two separate lists that each contain a part of these field names. So I would like to merge the two lists of field names and pass it over to the algorithm, but I have no idea how to do this.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB>Another solution could be to perform the ‘union’ first, and only afterwards ask the user to specify the field names for evaluation. Unfortunately, I have no idea either how to determine a chronological sequence where the ‘vector field’ input is queried after the ‘union’ has already been performed.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-GB>Thank you very much for your help, <o:p></o:p></span></p><div><p class=MsoNormal><span lang=EN-GB style='font-size:10.0pt;font-family:"Arial",sans-serif;mso-fareast-language:DE'><br><br></span><span style='font-size:10.0pt;font-family:"Arial",sans-serif;mso-fareast-language:DE'>Simon <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB><o:p> </o:p></span></p></div><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span style='mso-fareast-language:DE'>Von:</span></b><span style='mso-fareast-language:DE'> Nicolas Cadieux <njacadieux.gitlab@gmail.com> <br><b>Gesendet:</b> Mittwoch, 26. Januar 2022 17:21<br><b>An:</b> Simon Dietmann <simon.dietmann@pgnu.de>; qgis-user@lists.osgeo.org<br><b>Betreff:</b> Re: [Qgis-user] model builder - merge several inputs<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p>Hi,<span style='mso-fareast-language:DE'><o:p></o:p></span></p><p>You could try a "join attribute by location" followed by a "Aggregate"...<o:p></o:p></p><p>Nicolas<o:p></o:p></p><div><p class=MsoNormal>On 2022-01-26 3:43 a.m., Simon Dietmann wrote:<o:p></o:p></p></div><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><p class=MsoNormal><span lang=EN-GB>Dear list,</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-GB> </span><o:p></o:p></p><p class=MsoNormal><span lang=EN-GB>I am trying to find a solution for the following problem with the model builder:</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-GB> </span><o:p></o:p></p><p class=MsoNormal><span lang=EN-GB>My model asks for two vector polygon layers that will be combined by ‘union’. The resulting layer gets a new field (field calculator) and is evaluated by ‘Statistics by categories’ algorithm. The fields for the categories are selected by the user when calling the model. Since those fields are present in the two separate input layers, I have to use two separate ‘Vector field’ inputs.</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-GB>The problem arises when I try to combine those two input variables to use them together for the ‘Statistics by categories’ algorithm. AFAICS there is no function inside the model builder to achieve this, so I suggest I have to export the model as  a python script. There I found that the call of the Statistics function gives the name of the variable as a parameter and not the variable itself:</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-GB>alg_params = {</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-GB>            'CATEGORIES_FIELD_NAME': parameters['fields'], ….</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-GB> </span><o:p></o:p></p><p class=MsoNormal><span lang=EN-GB>How can I combine my two lists (~like “parameters[‘fields’+’fields2’], or is there a way to do this inside the model builder that I didn´t find?</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-GB>Thanks in advance for help, kind regards</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-GB> </span><o:p></o:p></p><p class=MsoNormal>Simon Dietmann<o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal> <o:p></o:p></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial",sans-serif;mso-fareast-language:DE'><br><br>Mit freundlichen Grüßen<br>im Auftrag</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial",sans-serif;mso-fareast-language:DE'><br>Simon Dietmann<br></span><span style='font-size:9.0pt;font-family:"Arial",sans-serif;color:#999999;mso-fareast-language:DE'>M.Sc. Physische Geografie</span><o:p></o:p></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Arial",sans-serif;color:#999999;mso-fareast-language:DE'> </span><o:p></o:p></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Arial",sans-serif;color:#999999;mso-fareast-language:DE'>Aufgrund der aktuellen Situation bin ich zur Zeit vermehrt im Home Office tätig und dort erreichbar unter +49 69 – 57 80 56 98 oder per Email, ich rufe Sie dann gerne zurück.<br><br></span><span style='mso-fareast-language:DE'><img width=202 height=87 style='width:2.1083in;height:.9083in' id="Bild_x0020_1" src="cid:image001.jpg@01D812DB.0639D1E0"></span><span style='font-size:9.0pt;font-family:"Arial",sans-serif;color:#999999;mso-fareast-language:DE'><br><br><br></span><o:p></o:p></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Arial",sans-serif;color:#999999;mso-fareast-language:DE'>PGNU Planungsgesellschaft Natur & Umwelt mbH<br>Amtsgericht Frankfurt am Main, HRB 111938<br>Geschäftsführer: Dr. Benjamin Hill, Johannes Christoph Kress, Alexander von Küchler<br>Hamburger Allee 45 +++ D-60486 Frankfurt am Main<br>Durchwahl: +49 (69) 95 29 64 - 75 +++ Fax: +49 (69) 95 29 64 – 99<br>E-Mail: <a href="mailto:dietmann@pgnu.de"><span style='color:#999999'>dietmann@pgnu.de</span></a> +++ Web: <a href="http://www.pgnu.de/"><span style='color:#999999'>www.pgnu.de</span></a></span><span style='font-size:10.0pt;font-family:"Arial",sans-serif;color:#999999;mso-fareast-language:DE'><br><br></span><span style='font-size:8.0pt;font-family:"Arial",sans-serif;color:#999999;mso-fareast-language:DE'>> Diese E-Mail könnte vertrauliche und/oder rechtlich geschützte Informationen enthalten. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail sind nicht gestattet.<br></span><span lang=EN-GB style='font-size:8.0pt;font-family:"Arial",sans-serif;color:#999999;mso-fareast-language:DE'>> This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.</span><o:p></o:p></p><p class=MsoNormal><span lang=EN-GB> </span><o:p></o:p></p><p class=MsoNormal><span style='mso-fareast-language:DE'><br><br><o:p></o:p></span></p><pre>_______________________________________________<o:p></o:p></pre><pre>Qgis-user mailing list<o:p></o:p></pre><pre><a href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a><o:p></o:p></pre><pre>List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><o:p></o:p></pre><pre>Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><o:p></o:p></pre></blockquote><pre>-- <o:p></o:p></pre><pre>Nicolas Cadieux<o:p></o:p></pre><pre><a href="https://gitlab.com/njacadieux">https://gitlab.com/njacadieux</a><o:p></o:p></pre></div></body></html>