# How do I create a Sub Total Column Please

**URL:** <https://community.glideapps.com/t/how-do-i-create-a-sub-total-column-please/67103>\
**Category:** Ask for Help\
**Created:** [October 19, 2023, 11:28am UTC](https://community.glideapps.com/t/how-do-i-create-a-sub-total-column-please/67103 "2023-10-19T11:28:50Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Desley](https://avatars.discourse-cdn.com/v4/letter/d/ac8455/32.png) [@Desley](https://community.glideapps.com/u/Desley)\
**Post date:** [October 19, 2023, 11:28am UTC](https://community.glideapps.com/t/how-do-i-create-a-sub-total-column-please/67103/1 "2023-10-19T11:28:50Z")

</div>

Gidday All,  
Hope you’re having a great day/evening. Okay here goes.

I have set up a data sheet where the Month/ Week Ending, Day Worked, Hours Worked, Hourly Rate, Hours Worked Amount.

 ![Screenshot 2023-10-19 221142](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/3/0/30fe2ff573e7a4c2a7019d7ce0d0b8807d34ec50.png)

All good so far. the Hours Worked Amount is a simple maths calculation column.

What I need to do is now create a sub total column of the hours worked amount which only calculates the specific values in this column for the specific week ending column.

For examples: July 15th has 2 days that have been worked. Hence I need to calculate $677.00 + $155.43 which then equals the total amount for this specific week ending data.

![Screenshot 2023-10-19 222552](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/a/2/a2b03293aacb7815d67c611282a116b480ace705.png)

Then I will need to set up a column that then calculates for the Month of July the 4 specific week ending dates for the month, based on the sub total.

Please note: I cannot do a simple roll up as this will not give the view of the week ending sub total or the monthly total.

I thought maybe a if - then - else however this does not appear to work either but did come the closest to what I am after, however not exact.

I thought it might be a sub total query column however couldn’t work this one out.

I thought of a look up column but because the sub total column is not calculated cannot do the job so to speak.

I thought of setting the Hours Worked Sub Total as a single value column however this doesn’t appear to work either.

Any and all suggestions would be greatly appreciated. Please give step by step process in your response so I can follow as I still have my Glide training wheels on.

Many thanks in advance and all support and assistance is greatly appreciated.

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [October 20, 2023, 1:02am UTC](https://community.glideapps.com/t/how-do-i-create-a-sub-total-column-please/67103/2 "2023-10-20T01:02:17Z")

</div>

- Create a query column that looks at this same table, and filter by “Week ending” is within the same day as this row \> Week ending.

- Create a rollup on top of that query column, sum the hours worked value.

---

<div class="post-metadata">

**Author:** ![Desley](https://avatars.discourse-cdn.com/v4/letter/d/ac8455/32.png) [@Desley](https://community.glideapps.com/u/Desley)\
**Post date:** [October 20, 2023, 5:28am UTC](https://community.glideapps.com/t/how-do-i-create-a-sub-total-column-please/67103/3 "2023-10-20T05:28:08Z")

</div>

Hi ThinhDinh,  
Many thanks for your response. To be honest I’m a wee bit lost. Is this what you mean please:

![Screenshot 2023-10-20 161248](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/0/2/02f5a5494de62599efeb2213e2efc8d9e21f9b1b.png)

It’s the step after this that I’m kind of lost on please.

When I create the roll up for the query, I get the whole column rather than simply the specific weeks

I can’t select the query column for the roll up.

 ![Screenshot 2023-10-20 162246](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/1/f/1fdbab3853a2476990093e124e2c2d4a5f01456c.png)

I then tried to add a filter via the fields in layout for the app and again the query column is not showing for me to add the filter there.

 ![Screenshot 2023-10-20 162654](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/1/a/1ab707570764ad8f7f4a29f6346a790783faeab8.png)

This is where I’m getting lost.

Any ideas and suggestions will be greatly appreciated.

Many thanks in advance.

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [October 20, 2023, 5:41am UTC](https://community.glideapps.com/t/how-do-i-create-a-sub-total-column-please/67103/4 "2023-10-20T05:41:59Z")

</div>

The filter on your Query is wrong.

It should be: Week Ending is within This Row → Week Ending  
Essentially your query should match all the rows that have the same Week Ending as the current row.  
This is sometimes referred to as a self-relation.

The “This Row” is easily missed in the Filter. You have to look carefully for it.

 ![CleanShot 2023-10-20 at 13.39.39@2x](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/5/b5fde75c1e0ec982cfbd96b2dce6fd17c354266e.jpeg)

---

<div class="post-metadata">

**Author:** ![Desley](https://avatars.discourse-cdn.com/v4/letter/d/ac8455/32.png) [@Desley](https://community.glideapps.com/u/Desley)\
**Post date:** [October 20, 2023, 8:44am UTC](https://community.glideapps.com/t/how-do-i-create-a-sub-total-column-please/67103/5 "2023-10-20T08:44:41Z")

</div>

Gidday Darren,  
Many, many thanks for your response - very greatly appreciated.

Yes, I missed the “this row” and very helpful image, however it appears I still cannot get this to total and I’m blowed if I know exactly what I’m doing incorrectly.

 ![Screenshot 2023-10-20 192324](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/7/c/7ca45c4ae46b3e5964f10515aca10f4317790dcb.png)

I also get the yellow warning label, however, I still cannot seem to obtain the relevant week ending total - still shows for each individual week - which is useful however to have the addition of the days worked within the same week ending (if more than 1 day) appears to escape me.

The info simply doesn’t appear in the data sheet with the query in place, nor does it appear in the drop down menu for the fields.

![Screenshot 2023-10-20 194205](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/7/f/7fca41c8003397805bd7d086fe598cc9677ed805.png)  
 ![Screenshot 2023-10-20 193323](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/c/0/c0df30dab094f749ca8fcbf9e65d53ded3e89bf2.png)

It’s probably still something simple that I’m missing however it still seems to escape me.

Penny for your thoughts please.

Many thanks in advance - For me the excel spreadsheet had the formulas worked out but these formulas do not transfer into Glide when the spreadsheet is imported.

Very greatly appreciate all the help and support I am receiving.

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [October 20, 2023, 9:02am UTC](https://community.glideapps.com/t/how-do-i-create-a-sub-total-column-please/67103/6 "2023-10-20T09:02:21Z")

</div>

Your Query column is still not correct. See below:

 ![CleanShot 2023-10-20 at 16.57.42@2x](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/6/0/60c1032cafbb20330985fb34119dff9e837ec161.jpeg)

Once you have the Query column correct, you then create a Rollup column.  
The Rollup column should target the column that you want to sum via the Query colum.  
And the output of the rollup column will be the result you are looking for (if you do it correctly).

---

<div class="post-metadata">

**Author:** ![Desley](https://avatars.discourse-cdn.com/v4/letter/d/ac8455/32.png) [@Desley](https://community.glideapps.com/u/Desley)\
**Post date:** [October 20, 2023, 9:40am UTC](https://community.glideapps.com/t/how-do-i-create-a-sub-total-column-please/67103/7 "2023-10-20T09:40:54Z")

</div>

Hi Darren,  
Many, many thanks. This appears to be partly working i.e.

 ![Screenshot 2023-10-20 201343](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/c/6/c6556c9900ea4d9049cd6d76b088b1baac2ea06d.png)

![Screenshot 2023-10-20 202751](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/e/bee8cd02ada3ecc1aca64a0e76b26e0c584e1be6.png)

However I see am unable to see the actual sub total amount in the fields area. Is this because it is a query column please for specific rows.

![Screenshot 2023-10-20 203047](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/a/7/a7ee5121563f8139c417e75c546e20061df61946.png)

When I do the roll up I receive the running total for all the rows in the column value (currently there are 26 rows. Now whilst this running total will be useful for my friend.

Do I then need to take this running total and say / by 26 fortnights or 12 weeks.

Will this be the way to go please.

Once again, many, many thanks for all the support and assistance you are providing - very greatly appreciated.

With the relation column it gives the complete roll up for the entire column thereby giving a running total. rather than the total i.e. for the specific month

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [October 20, 2023, 9:50am UTC](https://community.glideapps.com/t/how-do-i-create-a-sub-total-column-please/67103/8 "2023-10-20T09:50:40Z")

</div>

Please show me how your Rollup column is configured. I suspect that it isn’t correct.

---

<div class="post-metadata">

**Author:** ![Desley](https://avatars.discourse-cdn.com/v4/letter/d/ac8455/32.png) [@Desley](https://community.glideapps.com/u/Desley)\
**Post date:** [October 20, 2023, 9:53am UTC](https://community.glideapps.com/t/how-do-i-create-a-sub-total-column-please/67103/9 "2023-10-20T09:53:39Z")

</div>

Hi Darren,  
Many thanks. Here is a happy snap.

I couldn’t select the query column as not showing in the list.

 ![Screenshot 2023-10-20 205218](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/9/9/99537c57e3f365e4836a3f9cccc50fe4680adfb5.png)

I selected sum - should I have selected another option please.

Many thanks,

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [October 20, 2023, 10:05am UTC](https://community.glideapps.com/t/how-do-i-create-a-sub-total-column-please/67103/10 "2023-10-20T10:05:19Z")

</div>

You are rolling up the values in the whole table.  
Change that to use the Query.

---

<div class="post-metadata">

**Author:** ![Desley](https://avatars.discourse-cdn.com/v4/letter/d/ac8455/32.png) [@Desley](https://community.glideapps.com/u/Desley)\
**Post date:** [October 20, 2023, 10:10am UTC](https://community.glideapps.com/t/how-do-i-create-a-sub-total-column-please/67103/11 "2023-10-20T10:10:48Z")

</div>

Hi Darren,  
You are a champion of the very first order. Lots of big hugs. Thank you for staying the distance with me re this issue.

Yea, it now works. From the bottom of my heart thank you, thank you, thank you.

Very greatly appreciated.

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [October 20, 2023, 10:14am UTC](https://community.glideapps.com/t/how-do-i-create-a-sub-total-column-please/67103/12 "2023-10-20T10:14:21Z")

</div>

Great. Now I can watch the Aussies win the cricket 😉

---

<div class="post-metadata">

**Author:** ![Desley](https://avatars.discourse-cdn.com/v4/letter/d/ac8455/32.png) [@Desley](https://community.glideapps.com/u/Desley)\
**Post date:** [October 20, 2023, 10:15am UTC](https://community.glideapps.com/t/how-do-i-create-a-sub-total-column-please/67103/13 "2023-10-20T10:15:21Z")

</div>

Go for it. Who are we playing!!! 🤣 💖 💖 💖

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [October 20, 2023, 10:27am UTC](https://community.glideapps.com/t/how-do-i-create-a-sub-total-column-please/67103/14 "2023-10-20T10:27:49Z")

</div>

Pakistan

---

<div class="post-metadata">

**Author:** ![Desley](https://avatars.discourse-cdn.com/v4/letter/d/ac8455/32.png) [@Desley](https://community.glideapps.com/u/Desley)\
**Post date:** [October 20, 2023, 10:45am UTC](https://community.glideapps.com/t/how-do-i-create-a-sub-total-column-please/67103/15 "2023-10-20T10:45:46Z")

</div>

Well that will be interesting. Didn’t our Aussie team just scrap through in their last match? ☺
