Sometimes you need to output data in a way that is not easily accomplished via the standard report types. For example, displaying a report like the Multichoice Region Summary example.
In these cases, you may be able to use some additional mechanisms for looping through group members:
- MEMBERS - Loops all members of a group with data
- MEMBERS_WITH_BLANKS - Loops all members of a group regardless of if they have data
- MEMBERS_WITH_BLANKS_IN_RANGE - Loops all members of a group regardless of if they have data, but only if they fall within the range of groups that has data
- PLAIN_GROUP_MEMEBERS – Loops all members of a group without joining to datapoints, which is a faster method of just getting group member names
Note that these methods may be slower than the standard report types. They also do not support any of the functions supported by standard report types.
Examples:
#display all months of the year without joining to datapoints{|LOOP|DATATYPES.SHOW_DATATYPE.MONTH_OF_YEAR.PLAIN_GROUP_MEMBERS(SORT=ORDER_NUM)}
<td>{PLAIN_GROUP_MEMBERS.NAME}</td>
{/|LOOP|}
#display only months of the year that have data
{|LOOP|DATATYPES.SHOW_DATATYPE.MONTH_OF_YEAR.MEMBERS(SORT=ORDER_NUM)}
<td>{MEMBERS.NAME}</td>
<td>{COUNT(MEMBERS)}</td>
{/|LOOP|}
#display all months of the year regardless of if they have data
{|LOOP|DATATYPES.SHOW_DATATYPE.MONTH_OF_YEAR.MEMBERS_WITH_BLANKS(SORT=ORDER_NUM)}
<td>{MEMBERS_WITH_BLANKS.NAME}</td>
<td>{COUNT(MEMBERS_WITH_BLANKS)}</td>
{/|LOOP|}
#display all months of the year regardless of if they have data, but only if they fall within the range of groups that has data
{|LOOP|DATATYPES.SHOW_DATATYPE.MONTH_OF_YEAR.MEMBERS_WITH_BLANKS_IN_RANGE (SORT=ORDER_NUM)}
<td>{MEMBERS_WITH_BLANKS_IN_RANGE .NAME}</td>
<td>{COUNT(MEMBERS_WITH_BLANKS_IN_RANGE )}</td>
{/|LOOP|}
#filter a RESULT report type by group members, displaying counts for each multi-choice question for each month of the year
{|LOOP|DATATYPES.SHOW_DATATYPE.MONTH_OF_YEAR.MEMBERS(SORT=NAME)}
<tr>
{|LOOP|DATATYPES.SHOW_DATATYPE.GROUPS(FILTERSET=type|eq|question_multichoice,SORT=ORDER_NUM)}
<td>
{|RESULT|FILTER=MONTH_OF_YEAR_ID|eq||EVALTAG(MEMBERS.GROUP_MEMBER_ID)|}
{|LOOP|RESULT.DYNAMIC_GROUP(GROUP_ID=|EVALTAG(GROUPS.ID)|,RESULT_FILTER=WITH_BLANKS)}
{COUNT(DYNAMIC_GROUP)}<br/>
{/|LOOP|}
{/|RESULT|}
</td>
{/|LOOP|}
</tr>
{/|LOOP|}