☝️Small business or a startup? See if you qualify for our special offer.
+

Setting top n or bottom n filter on measure

Answered
Gokuldas Chandgadkar asked on June 17, 2025

Hi,

I am trying to see top n deposits by branch and account type, I want to dynamically set top 10 

, 20,50 or 100 deposits 

other scenario is reverse bottom n deposits

regards,

gokul

2 answers

Public
Gokuldas Chandgadkar June 18, 2025

Adding the sample code which I was trying to do see top n depositors by branch or account type

But somehow it looks like its not taking updated slice.

 

Regards,

Gokul

 

Attachments:
topndeposits.zip

Public
Maksym Diachenko Maksym Diachenko Flexmonster June 18, 2025

Hello, Gokul!

Thank you for writing to us.

Flexmonster supports setting various filters on values, including Top N and Bottom N filters (see the supported value filter list here: https://www.flexmonster.com/doc/implementing-filters/#values). These filters work based on subtotals for a specified hierarchy, based on which the filter is applied, and limit displayed results to the top or bottom N items based on a measure value.

After reviewing your current implementation, we have prepared a set of recommendations, which include the previous details of your setup. We have modified the JSFiddle code from our previous text to include predefined value filters in the report and implemented a value filter last via a dropdown: https://jsfiddle.net/flexmonster/js318km6/

Firstly, it is worth noting that since the value filters are linked to one of the on-grid hierarchies, they can only be defined in rows or columns, not in report filters. Therefore, the only option to use them is to implement a custom handler, like a drop-down, in your code. To set the filter, we recommend using the setFilter method. This approach is preferable to replacing the whole slice, as it is more efficient and safer. Also, note that Flexmonster does not provide a setSlice method and filterchange event. Please check the list of available objects, methods, and events in our documentation: https://www.flexmonster.com/api/

Please let us know if any further questions arise.

Best Regards,
Maksym

Please login or Register to Submit Answer