I have set up two search pages with a specific search and it works fine. I added in the google sheet a [=counta(X:X) formula and it gives me, for example for cities the total cities which is 77 and not the count for the specific search. What could be the problem.
How is your search set upm Is it a native Glide search, or did you create your own?
I wouldn’t use a Google sheet formula when you could use a Rollup column instead.
For it to work though, you would need to create your own search functionality which would involve a text entry component writing to a user specific column, followed by a Query column to find matching rows based on the search value, and finally a Rollup column to count the number of rows in the Query.
I created my own. I created a page for gender and city and the cities and gender drop down for me to select.
The dropdown is my filter for city and gender
I am using the Search function. Sorry for this
If by “search”, you mean the filter you’re showing in the screenshots above, then there’s nothing you can do about it since the filter data isn’t available for you to rollup.
You would have to build a custom filter like this.
Thanks.
I might be misunderstanding what you wrote here, but just to be clear - the Google Sheet has no awareness of any filtering that you may be applying in Glide. So any Google Sheet formulas will always give you a result based on the total number number of rows present in the sheet, regardless of anything that you do in Glide.
As others have suggested, this sort of thing is much better done using Queries and Rollups in the Glide Data Editor.
I tried the query and rollup but I do not think this type of search will work in Glide. It will give me the total, for example, cities, but I could not produce a total for each city produced in the search. When there are multiple cities to total Glide does not either. Thanks
It’s possible. It’s just a matter of constructing the queries, relations and rollups correctly.
I don’t know what your data looks like, but the simplest example is as follows:
- Create a multiple relation column that matches each city name with itself.
- Add a rollup column, target it at your multiple relation column, and take a sum of whichever column value you are interested.
The above will give you a sum per city (assuming the target column is a number type - of course, you cannot sum a text type column).
However, as was pointed out earlier, none of the above will work with the native filtering in Glide. If you want dynamic aggregations based on user specific filtering, then you must create your own filters.
See below:
Hi Benjamin Are you familiar with Darren H.'s video where he demonstrates filtering with choice components and date pickers to create sums and averages (rollups) using a helper table, user-specific columns and a query column? This combo is powerful.
I watched it but on my computer, his voice was slightly distorted in an attempt to understand what he was saying.
There’s a transcript on the right of the window, I think it’s pretty well transcribed.
Ok. I will look at it again. Thanks