You may wish to display information for several groups of similar types. Rather than create tags for each group individually, you can loop them and use them dynamically.


#datapoints with names for all groups displayed

<table>

  <thead>

    <tr>

      <th>ID</th>

      #loop all groups for the datatype

      {|LOOP|DATATYPES.SHOW_DATATYPE.GROUPS}

        <th>{GROUPS.NAME}</th>

      {/|LOOP|}

    </tr>

  </thead>

  <tbody>

  {|RESULT|}

    {|LOOP|RESULT.DATAPOINTS(LIMIT=10,SORT=ID)}

    <tr>

      <th>{DATAPOINTS.DATAPOINT_ID}</th>

      #for each datatype, loop each group and display the member the datapoint belongs to

      {|LOOP|DATAPOINTS.GROUPS}

        <td>{GROUPS.NAME}</td>

      {/|LOOP|}

    </tr>

    {/|LOOP|}

  {/|RESULT|}

  </tbody>

</table>


#datapoints with names for all groups of type 'client org' displayed

<table>

  <thead>

    <tr>

      <th>ID</th>

      {|LOOP|DATATYPES.SHOW_DATATYPE.GROUPS(FILTER=type|eq|client_org)}

        <th>{GROUPS.NAME}</th>

      {/|LOOP|}

    </tr>

  </thead>

  <tbody>

    {|RESULT|}

    {|LOOP|RESULT.DATAPOINTS(LIMIT=10,SORT=ID)}

    <tr>

      <th>{DATAPOINTS.DATAPOINT_ID}</th>

      #for each datatype, loop each group of type 'client org' and display 

      #the member the datapoint belongs to

      {|LOOP|DATAPOINTS.GROUPS(FILTER=type|eq|client_org)}

        <td>{GROUPS.NAME}</td>

      {/|LOOP|}

    </tr>

    {/|LOOP|}

    {/|RESULT|}

  </tbody>

</table>


#loop through all groups of type 'multiple choice question' and crosstab them by month

{|LOOP|DATATYPES.SHOW_DATATYPE.GROUPS(FILTER=type|eq|question_multichoice)}

<h2>{GROUPS.NAME}</h2>

{|CROSSTAB|}

  {|LOOP|CROSSTAB.MONTH_OF_YEAR(CROSSTAB_FILTER=NO_BLANKS,SORT=ORDER_NUM)}

  {|SHOWIF|LOOP.ISFIRST}

  <tabl>

    <thead>

      <tr>

        <th rowspan="2">Month</th>

        #loop each member of our current multiple-choice question group

        #DYNAMIC_GROUP used in conjection with GROUP_ID= will result in the

        #multiple-choice question group being determined by the GROUPS loop we're in

        {|LOOP|MONTH_OF_YEAR.DYNAMIC_GROUP(GROUP_ID=|EVALTAG(GROUPS.ID)|)}

          <th colspan="2">{DYNAMIC_GROUP.NAME}</th>

        {/|LOOP|}

      </tr>

      <tr>

        {|LOOP|MONTH_OF_YEAR.DYNAMIC_GROUP(GROUP_ID=|EVALTAG(GROUPS.ID)|)}

          <th>Count</th>

          <th>Percentage</th>

        {/|LOOP|}

      </tr>

    </thead>

    <tbody>

  {/|SHOWIF|}    

      <tr>

        <th{MONTH_OF_YEAR.NAME}</th>

        #loop each member of our current multiple-choice question group and display aggregates

        {|LOOP|MONTH_OF_YEAR.DYNAMIC_GROUP}

          <td>{COUNT(DYNAMIC_GROUP)}</td>

          <td>{PERCENTAGE(COUNT(DYNAMIC_GROUP), COUNT(DYNAMIC_GROUP,MONTH_OF_YEAR)).ROUND()}</td>

        {/|LOOP|}

      </tr>

  {|VANISHIF|LOOP.HASNEXT}

      <tr>

        <th>Total</th>

        {|LOOP|MONTH_OF_YEAR.DYNAMIC_GROUP}

          <td>{COUNT(DYNAMIC_GROUP,DYNAMIC_GROUP)}</td>

          <td>{PERCENTAGE(COUNT(DYNAMIC_GROUP,DYNAMIC_GROUP), COUNT(DYNAMIC_GROUP,OVERALL)).ROUND()}</td>

        {/|LOOP|}

      </tr>

    </tbody>

  </table>

  {/|VANISHIF|}

  {/|LOOP|}

{/|CROSSTAB|}

{/|LOOP|}