Summary on custom state
I have an invoices table which shows the Sub Total and the Profit per row. I have a custom column which shows the GP% and Markup% using a state().
I am wanting to have in the summary the overall percentage e.g (profit/Subtotal)*100 of all rows. I cannot for the life of my work out how to go about this one. Any help would be appreciated. Thank you.
5 Replies
Can you not use a custom summary for this?
https://filamentphp.com/docs/3.x/tables/summaries#custom-summaries
this looks like its only allowing. you to query the database? This is a custom state column.
I don't believe any of the summarisers have access to the state of each row in their column directly, they all just query the data to display from the database
You can see how they're implemented here: https://github.com/filamentphp/filament/tree/3.x/packages/tables/src/Columns/Summarizers
thank you for the info. Its not the end of the world
Presumably you can query the subtotal and profit for the database and calculate the overall percentage that way?
Should be a very fast query.