# Query group by....inside Glide?

**URL:** <https://community.glideapps.com/t/query-group-by-inside-glide/9641>\
**Category:** Ask for Help\
**Created:** [May 23, 2020, 12:16pm UTC](https://community.glideapps.com/t/query-group-by-inside-glide/9641 "2020-05-23T12:16:01Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gerard\_Fernandez](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gerard_fernandez/32/1183_2.png) [@Gerard\_Fernandez](https://community.glideapps.com/u/Gerard_Fernandez)\
**Post date:** [May 23, 2020, 12:16pm UTC](https://community.glideapps.com/t/query-group-by-inside-glide/9641/1 "2020-05-23T12:16:01Z")

</div>

Please…is it possible…??

Si if i have my list of invoices with this structure:

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/2X/a/a688828e6f66b32f92ac95cf30561e97ec2d8f99.png)

How can i Have an Inline list or List Relation showing something like this:  
(grouping by date and Product SKU)

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/2X/8/8a2e0476d2017c682e9f56ef1060ae6c41e5a2f5.png)

…inside Glide without using a new google sheet with query… group by etc

Thanks !

---

<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:** [May 23, 2020, 1:31pm UTC](https://community.glideapps.com/t/query-group-by-inside-glide/9641/2 "2020-05-23T13:31:27Z")

</div>

Hi Gerard, let me help you with this.

So I have some random data that is the same as your format.

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/2X/d/daf47b065ac3214b25eed2e39d3b09ba2371883d.png)

Then I create a template column that concatenate your date and ProductSKU (because that’s the unique value we have to “group by” for calculation).

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/2X/d/d7ab61ddd34ec5e076467c06da8dcd98697192c6.png)

Then I use a relation column to self-relate back to the template column I have just created.

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/2X/1/1991aa94fc85460656112e1547a2ae7a64ac6863.png)

Then I have a rollup column to calculate what you want to.

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/2X/5/543e2e0fa21472b81faf35bce145ec656cda8fce.png)

Hope it helps.

---

<div class="post-metadata">

**Author:** ![Gerard\_Fernandez](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gerard_fernandez/32/1183_2.png) [@Gerard\_Fernandez](https://community.glideapps.com/u/Gerard_Fernandez)\
**Post date:** [May 23, 2020, 2:03pm UTC](https://community.glideapps.com/t/query-group-by-inside-glide/9641/3 "2020-05-23T14:03:46Z")

</div>

Thank you for your time !!

In your guide I have total units sold by day and article what is ok. But when using the inline list it does not group rows by code and day. So if Art1 is sold 3 times in day 1, it shows 3 registers/rows for that same product. Hope you understand what I mean

---

<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:** [May 25, 2020, 2:58am UTC](https://community.glideapps.com/t/query-group-by-inside-glide/9641/4 "2020-05-25T02:58:43Z")

</div>

Yeah I have tried that as well but failed to show what you want. Hope somebody can chime in with a way to make only unique values shown.

---

<div class="post-metadata">

**Author:** ![Gerard\_Fernandez](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gerard_fernandez/32/1183_2.png) [@Gerard\_Fernandez](https://community.glideapps.com/u/Gerard_Fernandez)\
**Post date:** [May 25, 2020, 5:44am UTC](https://community.glideapps.com/t/query-group-by-inside-glide/9641/5 "2020-05-25T05:44:15Z")

</div>

Thanks again !! Perhaps @Jeff_Hager finds a workaround .

---

<div class="post-metadata">

**Author:** ![Gerard\_Fernandez](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gerard_fernandez/32/1183_2.png) [@Gerard\_Fernandez](https://community.glideapps.com/u/Gerard_Fernandez)\
**Post date:** [May 25, 2020, 6:55am UTC](https://community.glideapps.com/t/query-group-by-inside-glide/9641/6 "2020-05-25T06:55:23Z")

</div>

The curious thing here is that when showing a chart, the info is grouped, but is not possible to link to detail. So the grouping is done in glide, but not possible to show it in inline lists or relation lists. Clickable charts would be super also !!

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [May 25, 2020, 8:27pm UTC](https://community.glideapps.com/t/query-group-by-inside-glide/9641/7 "2020-05-25T20:27:09Z")

</div>

I have wanted this as well as I have a similar situation. I have a sheet with Lessons that are taught to students. In another sheet I have billing cycles where a coach can select a date range for billing of their students. Through formulas in the sheet, each lesson is assigned to a billing cycle. Then in a third sheet I use a query to get the unique Student/Coach/DateRange combination. This way, through relations, I can display only the student’s lessons that were taught by the signed in coach within the date range they selected. I my case I have several other columns doing calculations in the sheet and also incorporate payments for each billing cycle, so I’m satisfied with using a query.

A grouping or unique option would be nice, but I suppose in most cases a list in glide needs to relate to an actual row in the sheet Grouping wouldn’t allow you to do this and the only option would be to display a list with no action (like how you mentioned that charts work). Long story short, I don’t think it’s possible with the current glide only functions?

---

<div class="post-metadata">

**Author:** ![Errcomp](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/errcomp/32/13195_2.png) [@Errcomp](https://community.glideapps.com/u/Errcomp)\
**Post date:** [February 10, 2021, 12:50am UTC](https://community.glideapps.com/t/query-group-by-inside-glide/9641/8 "2021-02-10T00:50:11Z")

</div>

Any updates on this? Is there a way to do this in Glide now?

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [February 14, 2021, 6:35am UTC](https://community.glideapps.com/t/query-group-by-inside-glide/9641/9 "2021-02-14T06:35:38Z")

</div>

> [@prayheart\_eyes Add Query function to Glide Tables, Please!](https://community.glideapps.com/t/add-query-function-to-glide-tables-please/22533/11):
>
> Just want to add to this…if you need a workaround for now…what I would do is first make sure you have enabled the RowID column in your sheet. Then create a template with the unique key values you would normally select for a query. Then create a multiple relation that links that template back to itself. Then create a Single Value column to get the first RowID out of that relation. Then create an IF/Then column that returns ‘true’ if the row’s RowID matches the single value RowID. Finally create…

---

<div class="post-metadata">

**Author:** ![NoCodeAndy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nocodeandy/32/62530_2.png) [@NoCodeAndy](https://community.glideapps.com/u/NoCodeAndy)\
**Post date:** [January 17, 2024, 4:53pm UTC](https://community.glideapps.com/t/query-group-by-inside-glide/9641/10 "2024-01-17T16:53:24Z")

</div>


