Sum is not shown when on top

I created a page with 3 items:

  1. sum - sum of one of columns among all entries
  2. form button - add entry
  3. list - show all sheet entries

The sum is based on sheets SUM. Just added another entry which contains it (with some title value - title is just another column which its title is “title”…) .
When I put it at the end - works great.
But, because when adding an entry using the form submit, new entry is added at the end, then its value will not be included in the sum. I want that the “sum” will include all added entries.
So I moved the sum entry to the beginning.
But then - does not appear

Hi @Eyal_Orbach,

Could you please include a screenshot of your sheets? I am having a hard time visualizing the arrangement of data you have.

Just note, you cannot add a sum to a page, but you can add a component which displays a column of type sum, rollup etc… this is the item that I am unclear about.

Please add a little more detail and I’m sure we can get you up and running :slight_smile:

image

I put condition on by title column entry, by value is “total”
while filtering it out from list works (opposite condition - title is not “total”) , when adding it as “text” component with that value and condition - not shown at all.
as mentioned - when I put that total at the end - works
What is the “sum” component which you mentioned?

Hi @Eyal_Orbach,

Thank you for the picture.

So a couple things, first I would not use the 2nd row to hold the sum of your data. If you want to keep it in the same sheet I suggest you putting it in a new column and name that column sum (putting the actual sum in the second row).

Next to have the sum range expand when new data is added you should be using an array formula which will expand to the size of your spreadsheet. So instead of sum(B3:B30) you would put arrayformula(sum(B2:B)). B2 because we are getting rid of the sum in the 2nd row and B2:B as the array formula will sum the whole column. I also suggest deleting all unused rows currently 5 onward. (when a form is submitted it will automatically add a new row)

Now you should have 2 columns Item and cost which have no extra data and a new column called sum which contains a single cell showing the total cost.

To display the sum and the list you no longer need any filtering based on column 1 either.

Let me know if anything above needs more detail!

Thanks
but how come I do not need to make a filter?
Now I have second row which is an actual entry - so it shown as empty at list and yet not shown as text component

The sum component on the page should point to the new sum column.

Delete the empty cells in the first 2 columns.

For the sum you can also use a rollup column to sum the cost column in the glide data editor.

sum component --> “text” component, right? which is value is the sum column?

Yes

I do not get it

image

So that looks good, the sheet is done I think. Now just point the components in your page at the appropriate columns.

Ok so that I believe is because glides see more rows in the sheet so text wont show it.

what I would do is move the sum to another sheet and base the tab on that sheet. The inline list can reference anything as can the add button.

The new sheet will have 1 column with the title and the sum value and that’s it

Or display using an inline list and filter for non zero

Can you try using a rollup column inside Glide to do this?

1 Like

Thanks @ThinhDinh I did mention as an option above :slight_smile:

The issue with rollup is all rows will be filled with data that is not really the correct use case. though regardless, the issues above I do not see… The steps above taken seem to yield expected results for me…


image

It’s not a problem that all rows are filtered with data, as long as you can show the sum of all values as he wants. As I have said many times I want to keep everything in the Editor as much as I can and if he remembers to interpret it the right way and it works then totally fine.

1 Like

I don’t disagree

1 Like

@Cmstewart42 great, that’s works! thank you

@ThinhDinh Oh, nice. yet - also for me it is little strange that all rows will be filled. but OK.
Now I think I might use the other option. reason:
my app is some weekly expense app. so sum shall show summary by weeks.
What I thought is that in the big table - with all expenses to flag it with some value indicate which week (this, previous, 2 weeks ago) . Then in the new “total” sheet I can make relations and actually also make graph, based on that (e.g. pie by expense category and bar graph comparing weeks)

@Eyal_Orbach so glad it worked out!

Please mark as solution, thanks!

Yes, you can have a column in your Sheet that determines if it’s this week, last week etc. Then do a relation and rollup if you need to get the total for each type.