I need to create total of debits and credits without creating column for it
Hello, I need help on creating total where debits - credits would be the total. I want to put it under remarks. would it be possible?
Solution:Jump to solution
Did you try
```
->using(fn() => $query->sum('debits') - $query->sum('credits')
...
7 Replies
I'm using the built in summarize table
have you tried this one? this may fit to your use case
https://filamentphp.com/docs/3.x/tables/summaries#custom-summaries
Im so close to it but I'm not sure what logic need to use if I filtered the data using search or filters.
I believe to make the column be allowed to be searched, you need to add ->searcheable() and same thing for filters - you need to define the column of your filter to be matching the sumarizer column...
I am not an expert and have not yet used summarizer columns to show you an actual example, but it is a common rule for all columns to be filtered or searcheable, so ... Hope it gets you to the end and you can check the TableBuilder docs for the searcheable() method and filters...
Solution
Did you try
And remove the extra vars because they're probably not refreshing on table refresh
you're right , I define a static query there so thats why its not updating.