jQWidgets Forums

jQuery UI Widgets Forums Grid Customized Aggregate with exceptions

This topic contains 1 reply, has 2 voices, and was last updated by  Peter Stoev 9 years, 9 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Customized Aggregate with exceptions #74136

    drv232
    Participant

    I have a customized aggregate function that calculates weighted means over two columns

    I need to add exceptions to this weighted means calculation.
    There are some very large values in my database that skew off my mean.

    I want to show these values in the grid but exclude them from the aggregate calculation.

    I tried to splice the data.subItems array of objects, but that removes the object and does not display it in the grid.

    How can I do this. My code for the calculation is as follows

    
    var sumMarketVal=this.getcolumnaggregateddata('MarketVal', ['sum'], true, data.subItems);
    
    var sumPa=this.getcolumnaggregateddata('Prod1', ['sum'], true, data.subItems);
    var sumMarketValStringified=parseFloat(sumMarketVal.sum.replace(/,/g, ''));
    console.log("typeof(sumPa):"+typeof(sumPa.sum)+"typeof(sumMarketValStringified):"+typeof(sumMarketValStringified));
    weightedMean=sumPa.sum/sumMarketValStringified;
    console.log("weightedMean"+weightedMean);
    
    

    Let me know if you need more of my code for reference

    Thank You

    Customized Aggregate with exceptions #74142

    Peter Stoev
    Keymaster

    Hi drv232,

    Custom aggregation functions are demonstrated on: http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/customaggregates.htm?arctic

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.