Filter appears to be a sub-string match rather then the exact match

I have a field that asks for Gender
When I filter by ‘Female’ or ‘Other’ the filter works correctly.
However, when I filter for ‘Male’, the filter returns all ‘Male’ and ‘Female’ rows.

My suspicion is that it is because male is a substring of female.

The filters should be searching by an option variable ideally, especially for ‘Select One’ or ‘Select Many’ questions but if you must do them by string matching, then it should be an exact match in these cases.

1 Like

Hi @Sceptre,

Thank you for flagging this issue in the community (and expecting the same in upcoming days as well)! Just made a check and was able to replicate the issue at my end.

In the survey tab of your xlsform:
Image 1

In the choices tab of your xlsform:
Image 2

Filtering male choice (where sex variable coded in number) from DATA>Table:


Remarks: Has no issue.

Filtering female choice (where sex variable coded in number) from DATA>Table:


Remarks: Has no issue.

Filtering female choice (where sex variable coded in text) from DATA>Table:


Remarks: Has no issue.

Filtering male choice (where sex variable coded in text) from DATA>Table:


Remarks: Here is the issue. When you try to filter a choice whose names are coded in text.

Reference xlsform:
Filter Test (View Table Data) 2020 09 15.xlsx (11.0 KB)

FYI, please be informed that i have created a GitHub issue for this and it can be followed here:

Have a great day!

1 Like