Calculating percentages based on items in category

So I’m trying to make a task app that contains tasks and categories for those tasks.

I want to be able to use the progress bar component in my app to show how many apps in a certain category are completed, but for some reason I’m confused on how to go about this.

I’ve created a relation to sort which tasks are in which category, and I have a true/false column in my sheet that shows if the task is completed. I’m just a bit confused as to how to pull all of this together to use the component I want.

Sorry if this is such a basic question, but thanks for reading and taking the time to help me :slight_smile:

While you are waiting for one of the experts to answer your query, you might find the following useful.

https://docs.glideapps.com/all/reference/components/charts/progress-bar

I’ve added a progress bar that auto-populates itself on completion of each task to a Glide app. It’s quite easy. Just use the Data editor to do it.

What exactly is the problem you are having? I’m guessing part of it might be the dynamic nature of your lists, but having to set a specific range. To deal with that you would be best off setting the max range of the progress bar to 100 and calculating the percentage of completed tasks.

To get your values, I would first create a template column in your tasks sheet of the category and the checkbox value. In the Category sheet, create a template column of the category and the word ‘true’. Then in the category sheet, create a relation to link the category to the category in the task sheet. Create a rollup count using the relation to get the total number of tasks in that category. Next create a second relation using linking the template columns in both sheets. Create a rollup count using this relation to get the total number of tasks that have been completed. Now create a math column that takes the completed task count, divides it by the total task count, then multiplies by 100. This will be the percent complete out of 100.

Thanks so much for taking the time to type out your response! I’m sure it’s me and not you, but I wasn’t able to follow along with the steps outlined here.

To get your values, I would first create a template column in your tasks sheet of the category and the checkbox value. In the Category sheet, create a template column of the category and the word ‘true’. Then in the category sheet, create a relation to link the category to the category in the task sheet. Create a rollup count using the relation to get the total number of tasks in that category

Okay, I believe I did this correctly, this is what it looks like:


Next create a second relation using linking the template columns in both sheets. Create a rollup count using this relation to get the total number of tasks that have been completed.

This is where you lose me, I’m sorry.
xtqig.glideapp.io

I’m assuming you are referring to this, which looks like you already solved your problem?

Yessir! thanks for the walk through!

1 Like

Hi @Jeff_Hager, on the basis of your approach, I’m trying to build a simple dashboard (fully in the dataeditor since based upon data calculated in it, ie. not synchronised). I struggling because I want to sum some points (vs counting “true = 1” in the case above).

I have 2 sheets:

  • challenges: multiple challenges per category, with ‘points won’ per challenges (3 types of level of points : 10, 5, 0)
  • dashboard with categories: this is where I want to and “sum” values to collect per category

I made a relation between both sheets (cf. “subjectMacro” = category), then tried a lookup but I don’t see how to use the results.

I am thinking about a 3 if-then-else in the “challenges” sheet to identify the nb of points “10”, then “5”, then “0” ; then count each if-then-else, then multiply by the pointsvalue in the Dashboard sheet… But is there something less heavy?

image

Many thanks if you have an idea!

Have you tried to create a Rollup column against the relation to sum the points?

1 Like

How did you handle the second half of the problem; counting the number of completed task by category?

If you use a boolean to determine whether the task is completed or not, you can use a rollup over your relation from category to task, and count the “true” entries.

1 Like

Thanks Thinh, I have a follow up question.

I’ve since added a filter to my collection to only show relevant tasks based on the user type (Muslim or Non-Muslim or both) by matching the Applicable column in Checklist table with User Profile > Mode.


^ The tasks on Checklist table.


^ The mode on Users table.

This means that both types of users will see a different number of total tasks. How do I reflect that in my Progress table?


^ My current setup on Progress table to count number of total tasks; Relation to Category + Rollup.