Do a search for get more fields value than one

Is there a way, when I do, do a search for list of elements, to get more values than just one? As I need a sum of 3 fields plus one other search, so is there a way to do a search once and just get 3 fields total from this search (sum of field A, B and C from this table) instead of adding 3 times do a search for with same constraints?

/example
Table ativities where parameter X=X1, has 3 types of cost values= A, B and C - and what I am looking for is a sum of all 3 - not doing the search 3 times, as I need to use this on a repeating group.

Thanks!

  1. Consolidate the search
    IE Instead of doing the search in all the places where you need its data, do the search once, and then reference this result instead. This might mean placing a ghost/invisible Repeating Group that does not have any elements in it, using the search as its data source, and then using RG's List of Things to reference the search multiple times. This also has the huge benefit of increasing maintainability; if you need to change the parameters in the search, you only need to do so in one place.

  2. Use the :group by operator
    After the search, use the `:group by’ operator to aggregate the Sum of the fields you are interested in. You can add multiple aggregators to a group by, which is very handy. To get the total sum of the fields, simply run the sum of the field sums. The group by operator is much more efficient than just running the sum of the fields in a search, because you are returning much less data to the page and the server operation is generally more efficient. However you will lose all the other data returned by the search, so if you need any more data this might not be the way to go.

1 Like

Never used step 2, but already got an idea to go for step 1. So if you confirm that’s a good idea, I will definitely go for this. As as you have said, it sounds like a very good solution, making the report page more maintainable.

1 Like

I confirm :grin:

Whats your plan for step 1?

Simple. To get a list of all the elements that match criteria and then refer to them from their fields. But now the idea has changed a bit, as I need to export those data later to excel. And I currently was using create CSV Plugin which cannot handle properly the cases when I request a table like:
Column 1 - Element ID
Column 2 - All current Elements - Things

As the column 2 then lists only 1 item, not all relevant items to the element I have.

I would build it as a tabble in bubble, but in the end I need to export that to Excel and it is a nightmare to copy that from bubble. (it is copied as a long string not as a table)
Unless there is something that I don’t know.