<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Dear QGis users,<br>
    <br>
    I'm trying to display an attribute tables showing synthetic values
    in the print layout : sum, and percentage,  of areas of different
    classes in the french land cover (and number of polygons, in a
    checking purpose).<br>
    "id" is the primary key of a polygon in the layer.<br>
    "CODE_CS", the land cover, is a texte field.<br>
    "S", the area, is a calculated fiel (type: real)<br>
    <br>
    Whereas the count of each class is correct on the symbology (left
    and bottom of the screen capture),  some values are duplicated, and
    some other values are missing in the the table, on the <b>layout </b>(up
    right of the screen capture). Only 3 classes are shown out of 14.<br>
    There is no filter or selection active.<br>
    My expressions are:<br>
    Area: sum((round("S"/10000,0)), group_by  :="CODE_CS" )<br>
    Percentage: round(sum("S", group_by  :="CODE_CS" )/sum("S")*100
    ,2)|| '%'<br>
    Number: count("id", group_by:="CODE_CS")<br>
    <br>
    I'm on Qgis 3.34.8.<br>
    <br>
    Thank you very much for any help or clue!<br>
    Yours sincerely,<br>
    <div class="moz-signature">-- <br>
      <div style="line-height:10pt;margin:10px
        0;font-family:marianne,arial,sans-serif;">
        <div style="font-size:9pt;"><b>Celine HECQUET</b><br>
          <span style="font-size:8pt;">SUCT/PCAT<br>
            <br>
          </span>Avenue Demontzey BP 211 04002 DIGNE-LES-BAINS CEDEX<br>
        </div>
        <p style="font-size:8pt;margin:15px 0;">Bureau : 112<br>
          Tel : +33 492305661<br>
          <span><a style="color: rgb(0, 0, 0); font-size: 8pt;
              font-weight: bold; text-decoration: none;"
              href="https://www.ecologie.gouv.fr">www.ecologie.gouv.fr</a><br>
          </span></p>
        <table
style="border:0;line-height:10pt;border-collapse:collapse;width:auto;background-color:#fff;">
          <tbody>
            <tr style="border:0">
              <td style="padding:0"><br>
              </td>
              <td
                style="border:0;text-align:left;vertical-align:middle;padding:0
                0 15px 15px" rowspan="3" valign="center" align="left"><span
                  style="display: block; font-weight: bold; font-size:
                  9pt; line-height: 9pt; color: rgb(0, 0, 0); max-width:
                  200px;">Direction Départementale des Territoires des
                  Alpes-de-Haute-Provence</span></td>
            </tr>
            <tr style="border:0">
              <td style="border:0;border-right:1.5px solid
                #3c3c3c;text-align:left;vertical-align:middle;padding:5px
                15px 5px 0" valign="top" align="left"><br>
              </td>
            </tr>
            <tr style="border:0">
              <td
                style="border:0;text-align:left;vertical-align:top;padding:3px
                0 0 0" valign="top" align="left"><br>
              </td>
            </tr>
          </tbody>
        </table>
      </div>
    </div>
  </body>
</html>