var queryTask = new esri.tasks.QueryTask(layerServiceUrl); var query = new esri.tasks.Query(); query.where = "1=1"; query.outFields = ; query.outFields.push(field); query.returnDistinctValues = true;
Solved! Go to Solution.
For a temporary hack until the Query property supports the feature, try tacking it into your QueryTask url definition. It may not work in all cases.
example: var qtask = new QueryTask(url + "?returnDistinctValues=true");
The result will be a short list of distinct values with respective feature counts. Hope this helps.
PS or go with what Kelly suggests in the post Robert refers too.