Table Column Relationship Sum, Avg, Max, Min, ext being ignored
I have model that consists of products. The products have a relationship of locationInventory that contain the inventory numbers for each location. On my Product Resource Table, I have a column like this:
Based on the documentation here: https://filamentphp.com/docs/3.x/tables/columns/relationships#aggregating-relationships, this should sum the total amount of quantity_in_stock for all locations. However, what I’m getting is a list of values instead.
Any pointers on what I might be doing wrong?
I have made sure the inventory values are casted to Integers and Floats, updated filament, cleared all caches.
Based on the documentation here: https://filamentphp.com/docs/3.x/tables/columns/relationships#aggregating-relationships, this should sum the total amount of quantity_in_stock for all locations. However, what I’m getting is a list of values instead.
Any pointers on what I might be doing wrong?
I have made sure the inventory values are casted to Integers and Floats, updated filament, cleared all caches.
Solution
changing it to quantity_in_stock_sum made the column blank. But changing it to quantity_in_stock has it properly summing the values. Thanks for your help!