How to map all the checkboxes in a row and sum the ones checked

Hi community,

I came from Notion and started coda 2 weeks ago for the automations and formulas. In both tools I have set up a habit tracker, but I want to automate it as much as possible.

So in my columns I have several checkboxes that represent the habits I’m tracking. I can add each one by name, but to make it fully customizable I would like to map all the checkboxes, count them regardless of whether they are checked (denominator) and sum the marked ones (numerator). Is it possible to do this?

I put the published template so you can take a look.

The idea will be to have the same result as the “Accomplished” property but without adding each habit.

@Sebastian_Zegada
Hello,

You can use the interactive filters and make two views (Table and Chart : PIE), but there is surely a better way to do it with formulas using the .filter(). I invite you to have a look at the documentation about formulas (Coda | Formula library)

Sincerely,

Thierry

2 Likes

Dear @Sebastian_Zegada,

I am not able to test it, but to my opinion solution is in this post: Tally up all check boxes in a row - #5 by Nick_HE

Edit:

This is the formula and explanation how it works

The “tonumber” is used to convert the output to a number in case you want the use the outcome to make calculations, like the percentage of achieved goals.

1 Like

Thank you Jean-Pierre!! I really like your solution, although it’s not what I’m looking for.

I don’t want to explicitly write the columns, because I want whoever manages the template to never need to touch the formulas. What I’d be looking for is a bit more like this:

So, whatever that allows me to convert all the row values into a list, or something similar, would be my solution.

Thank you so much for your time.

2 Likes

Hi @Sebastian_Zegada :blush: (and Welcome to the Community :partying_face: ),

I could be wrong but as far as I can tell, there’s sadly no way to reference all columns of table at once… which makes sense though, as each column contains a specific value for a row …

1 Like

Hi @Sebastian_Zegada
I can confirm there is no way to programmatically reference columns metadata.

However…

Sometimes it’s just a matter of how to model data.
In this case, instead of considering your habits as columns (à la Excel) , how if you make them as first citizen separate entities?

Have a look at this example:

Maybe it can result slightly more complicated at the beginning, but it’s more powerful from a data perspective because:

  1. you decouple the two main dimensions (date and habit)
  2. you can change/amend/add/remove habits as time passes by, without affecting the structure
  3. you have a more solid structure for stats/report reference
  4. (as per this topic): you don’t need any hardcoded logic in your formulas.

I hope this helps.
Cheers!

5 Likes

Thank you @Pch for your answer.
Yes, I was hoping to have something like SQL query, where you can put “SELECT * FROM…” And it takes all the columns.
Well, I believe I will need to adapt the template just like @Federico.Stefanato suggests.

3 Likes

@Federico.Stefanato that’s a great idea!!! Just a paradigm shift. Thank you!!

Yes, I worked the habit tracker that way because it was the best way to do it in Notion. In fact, my first approach was exactly like you show me, but manage it like this in Notion was very frustrating.

I’ll give it a try and then share you the final result.

Thanks again.

4 Likes

Well, yes… :smirk:

Thank you! Everybody would appreciate.

3 Likes

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