Issue #1828790 by plach, chx, pfrenssen: Fixed Entity count query not working with fields shared among different entity types.