Getting count using custom script

I have over 5000 invoices for different product let say (1200 for product A, 300 for product B, 983 for product C). I am creating a HTML in which I am showing count corresponding to product. Like

A-> 1200 … B-> 300
But for that I actually had to parse whole data via frappe call and group it based on product and increase the count. But this is taking over 5 minutes time.

What I want to achieve here is I run a frappe call just for count with SQL functions like aggregate,group by, so that I can get all product’s and their count in less time and then render it to HTML. Any help for achieving so ?

Solved. Used list view’s property

How do that script?

agree, would be nice whether you could post your custom script in detail

1 Like