Skip to main content

Does anyone know how I would set “Having” (as described in the following community post) via JavaScript Snippet? I would like to create a table filter based on Having. Thanks!




i have an aggregate model that counts the number of times a first name last name combination appears in the client object can i filter the model to only display > 1 for the count ? 5image]

“Havings” / “Post-Aggregation Conditions” can be set via JavaScript using the same API’s that are used for setting “Pre-Aggregation Conditions”: getConditionByName( ) and setCondition( ). getConditionByName( ) will search through both Pre- and Post- Aggregation Conditions when searching for name matches, and setCondition( ) works on either Pre- or Post- Aggregation Conditions.

For instance, if you have an Aggregate Model named “AggData” with a “Having” Condition named “recordCount”, you can set the value of this Condition from JavaScript like this:


var model = skuid.$M("AggData");<br>var recordCountCondition = model.getConditionByName("recordCount");<br>model.setCondition(recordCountCondition, 42);




Zach To the Rescue! I Always appreciate everyone’s help. Thanks!


Just wanted to say Thanks for this also.  We implemented ‘Havings’ on our community Skuid page to expose our available inventory.  One of our filters is on quantity, and we needed that post aggregation condition on our model to sum the inventory quantities together and the return results.  Used a JS snippet to set the condition and return the results.  Good stuff.