Wrong sorting at columns that has "SUM" aggregation in grouping rows

Posted by: m.omar on 8 February 2020, 12:19 am EST

  • Posted 8 February 2020, 12:19 am EST


    Problem steps:
    ---------------------
    1-Grid has grouping by "country" column and has "sum aggregation" at "sales" column
    2- User click on header of "sales" column to sort descending , it sorting fine in details and grouping rows values.
    3- but if user click on header of "sales" column to sort ascending, it sorting fine in details and sorting wrong in grouping rows values.
  • Replied 8 February 2020, 4:33 pm EST

    Can someone help me with this?
  • Replied 9 February 2020, 3:56 pm EST

    Hi Omar,

    As per our understanding, your issue is related to how sorting is done when the data is grouped.
    When grouping is applied and the data is sorted by a column, the data is sorted first and then the groups are created. This means that the groups are not sorted according to the aggregate values instead they are sorted on the basis of the data.
    In the screenshot below, notice that the Sales column is sorted in descending order and the data inside the groups are sorted in descending order but not the groups itself.

    Let us know if this clears your doubts or otherwise.

    Regards,
    Ashwin
  • Replied 9 February 2020, 6:53 pm EST

    Yes this is the issue, i want "sales aggregate values" to be sorted descending
    too.
    So your example result should be as following: https://ibb.co/bXFpzJD
  • Replied 10 February 2020, 5:56 pm EST

    Any update !!
  • Replied 10 February 2020, 9:02 pm EST

    Hi Omar,

    We have asked the dev team on whether this can be achieved. The tracking id of the case is 420613. We will update you as soon as we will hear from them.

    ~regards
  • Replied 15 February 2020, 4:36 pm EST

    Are there any updates regarding this issue ?
  • Replied 16 February 2020, 5:21 pm EST

    Hi Omar,

    We are sorry but the issue is still with the dev team. We have asked them to provide an ETA on this.

    ~regards
  • Replied 17 February 2020, 7:00 pm EST

    Hi Ashwin,
    This issue affects our business so please level up its priority?
  • Replied 18 February 2020, 2:38 pm EST

    Hi,

    I have told the dev team that this issue is a show stopper for you and to resolve it at the highest priority.

    ~regards
  • Marked as Answer

    Replied 19 February 2020, 4:24 pm EST

    Hi,

    You can use the sortConverter property of the CollectionView to convert the values to their individual aggregated values. Please refer to the sample link below:

    https://jsfiddle.net/Wijmo5/bs42zk0r/

    ~regards
  • Replied 22 February 2020, 7:35 pm EST

    Good job , it works like a charm
  • Replied 22 February 2020, 7:36 pm EST

    It works perfect, thank you Ashwin.
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels