# The last training of the week

**URL:** <https://community.glideapps.com/t/the-last-training-of-the-week/56165>\
**Category:** Ask for Help\
**Created:** [December 30, 2022, 8:03am UTC](https://community.glideapps.com/t/the-last-training-of-the-week/56165 "2022-12-30T08:03:47Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![alternaz](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/alternaz/32/51860_2.png) [@alternaz](https://community.glideapps.com/u/alternaz)\
**Post date:** [December 30, 2022, 8:03am UTC](https://community.glideapps.com/t/the-last-training-of-the-week/56165/1 "2022-12-30T08:03:47Z")

</div>

Hello community!

I created a fitness monitoring application with 10 training sessions divided into 5 categories.

I have a dashboard page in which I inserted 2 big numbers.

I try to display in the first one : the last type of session that I practiced the current week.

To put it simply, if my last session was “running” I want to see the mark “last session: running”

I am also looking for how to roll up the trainings of the current (from Monday to Sunday) and put the data on my big numbers 2.

 ![Capture d’écran 2022-12-30 à 09.02.58](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/f/6/f61aefac167d2fda65f76675b3ca917652db24f0.png)

Do you have an idea of ​​how I can store my data to achieve my goals?

Best

---

<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:** [December 30, 2022, 9:31am UTC](https://community.glideapps.com/t/the-last-training-of-the-week/56165/2 "2022-12-30T09:31:38Z")

</div>

> [@alternaz](#):
>
> To put it simply, if my last session was “running” I want to see the mark “last session: running”

For this one you can use a Single Value → Last

> [@alternaz](#):
>
> I am also looking for how to roll up the trainings of the current (from Monday to Sunday) and put the data on my big numbers 2.

For this one, you’ll first need to calculate the date of Monday of the current week. You can do that with the following math formula:

```auto
Now+
MOD(8-WEEKDAY(Now),7)
-6
-HOUR(Now)/24
-MINUTE(Now)/1440
-SECOND(Now)/86400

```

 ![Screen Shot 2022-12-30 at 5.27.58 PM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/5/8/584af009c7d50ce8a5eea62dac6781f43aa93662.png)

Next, add an if-then-else column to your Log table:  
– If training date is on or after Monday (math column), then true  
Finally, use a rollup column to count the number of true values in the if-then-else column.

---

<div class="post-metadata">

**Author:** ![alternaz](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/alternaz/32/51860_2.png) [@alternaz](https://community.glideapps.com/u/alternaz)\
**Post date:** [December 30, 2022, 11:12am UTC](https://community.glideapps.com/t/the-last-training-of-the-week/56165/3 "2022-12-30T11:12:06Z")

</div>

It works perfectly, you are a beast !!

Thank you !

I’m looking to finalize, I have a chart with my differents types of trainings but surprisingly I only have 10 results while my data set has 85 lines.

 ![Capture d’écran 2022-12-30 à 12.07.16](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/4/d/4d7ab4c6f89bbba1c8cfa56bfb6e77428587f97a.png)

This chart is pointing to my “Type of training” column (with 85 lines). I checked, the number of item was not limited.

Maybe I have to create a roll up per different type of training ?

Best.

---

<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:** [December 31, 2022, 1:07am UTC](https://community.glideapps.com/t/the-last-training-of-the-week/56165/4 "2022-12-31T01:07:08Z")

</div>

> [@alternaz](#):
>
> I’m looking to finalize, I have a chart with my differents types of trainings but surprisingly I only have 10 results while my data set has 85 lines.

Is this different types of training for each user, or is it targeting the whole table? Can you share some screenshots of your setup for this?

---

<div class="post-metadata">

**Author:** ![alternaz](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/alternaz/32/51860_2.png) [@alternaz](https://community.glideapps.com/u/alternaz)\
**Post date:** [December 31, 2022, 10:36am UTC](https://community.glideapps.com/t/the-last-training-of-the-week/56165/5 "2022-12-31T10:36:44Z")

</div>

Hello,

There is the same types of trainings for all users.

Datas :

- There is only 85 lines on my tab “Training sessions” so, only 85 trainings sessions;
- One session has only one type of training;
- I have 5 types of trainings.

One IF column named “Type d’entrainement” with all the types of my trainings.  
One “total entrainements” column with all the training from the start.  
I created a boolean column by type of training (true/false) to get the number from one specific type of training.

I have one roll up field with the number of all trainings, called “Type d’entrainement”.

There is one video :

My current chart with figures that do not correspond at all to reality (I only have 85 training sessions).

 ![trainings](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/0/c/0c7da142206d6f078c9f66fa8a12365a1a1b911f.jpeg)

Have you some idea ? 🙂

---

<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:** [December 31, 2022, 10:42am UTC](https://community.glideapps.com/t/the-last-training-of-the-week/56165/6 "2022-12-31T10:42:07Z")

</div>

Can you show how your chart is configured?

---

<div class="post-metadata">

**Author:** ![alternaz](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/alternaz/32/51860_2.png) [@alternaz](https://community.glideapps.com/u/alternaz)\
**Post date:** [January 1, 2023, 12:23pm UTC](https://community.glideapps.com/t/the-last-training-of-the-week/56165/7 "2023-01-01T12:23:04Z")

</div>

Yes

 ![1](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/c/1/c14137045e3c73fb795ae76613e74a219e5bc74f.jpeg)

 ![2](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/5/d/5d4e1e71d31eb257a01b8d0b0e219e438b2b876d.jpeg)

I did 44 sessions of “intense cardio”, I would have to manage to use this unique value “44”, instead I have a 44 to all rows which add up to a huge number.

---

<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:** [January 1, 2023, 12:33pm UTC](https://community.glideapps.com/t/the-last-training-of-the-week/56165/8 "2023-01-01T12:33:39Z")

</div>

Okay. I would probably do this a little differently.

What I would suggest is to create a “Training Types” table. This needs a column with one row for each type of training. Then create a multiple relation from this table to your Training Log table, matching the training type in each. Then add a rollup-\>count via that relation. Then use this table as the source for your chart.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)\
**Post date:** [January 2, 2023, 12:34pm UTC](https://community.glideapps.com/t/the-last-training-of-the-week/56165/9 "2023-01-02T12:34:32Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
