// Create a target filter containing only those properties belonging to this dataset.
FilterByCriteria targetFilter = filter.cloneFilter();
String[] remainingPropIds = filter.getPropertyIds();
for (String propId : remainingPropIds) {
if (getPropertyById(propId) == null) {
targetFilter.removeProperty(propId);
}
}
// Go ahead only if the target filter contains at least one property.
if (targetFilter.getPropertyIds().length == 0) {