Tana is launching a new product 🚀 Get early access
⚡️ Ideas
Sarah Arminta Sarah Arminta Nov 26, 2024
Posted Sat, Mar 4, 2023 5:53 AM
Edited Tue, Nov 26, 2024 10:46 AM

Formula Field

Explain the problem as you see it

Currently it requires too much manual work and data entry to manage areas like finances, fitness, or any subject that involves simple numbers and calculations. Even being able to do something like concatenate strings or calculate dates is not currently possible.

Why is this a problem for you?

Most of my work involves numbers and calculations and it takes too much work to manage this information in Tana at this time.

Suggest a solution

Please add a formula field type or add a formula section to the current field types. Basic math, string manipulation and date calculations would be a great place to start.

⁨19⁩ ⁨Comments⁩

I agree very much 👍, I've been expecting this feature too, sometimes I feel particularly inconvenient, for example, I have a #task tag which has a month field inside, I expect that every time I apply the #task tag in the node of my notes, Tana can calculate the current month and assign a value to this field according to the function I configured in advance, but because the current version doesn't support I have to configure this field manually each time, which is a pain 👿

I also consider this an essential feature, so that collected information can be displayed in concise and readable formats. Beyond date calculations, I need robust date formatting. My standard time & date displays use one of the following formats: YYYY-MM-DD, YYMMDD or YY.MM.DD, with time optionally appended as either "-HHmm" or " HH:mm". I virtually never include day of week or the month name instead of number. Also, many times only the year or year and month are important or even relevant. Tracking books and reading is a popular theme in Tana examples, and an important thing for me in my reading history is sorting books by copyright date, which is only a year. Ideally, I could enter only a year for a date, but if I have to be more granular on entry I still don't want to see "January 1, YYYY" on output, like I've had to do in other apps.

As for implementation, the Unicode forum has made code available to support this functionality for years. They have user level specifications for date/time formats, which can be found at https://unicode-org.github.io/icu/userguide/format_parse/datetime/#datetime-format-syntax. The root node for the complete description of these and other Unicode forum services is at https://unicode-org.github.io/icu/userguide/icu/.

In reply to Winston Winston

While there are a lot of great things coming down the pike with AI, it's still not there. Very few know how to use it and a lot more are not comfortable with its existence. Formulas are an inherent component in other productivity/PKM apps such as Notion, Coda and Obsidian. I am surprised that Tana doesn't have this out of the gate. However, what it does currently, it does very well. I just hope that developers understand what a critical component this is to those of us who are granule thinkers (which I would believe are a large chuck of the current user base) and require views to incorporate such data.

In reply to Kelley Chambers Kelley Chambers

Hugely agree with this. I hope some of the Tana team has played around with these formulas in Notion or Clickup so that they understand how powerful these "formulas" can be. It is one of the bedrocks of "Notion templates", and people sell these formulas. But if they are working on it, I'm pretty sure the Tana team can integrate it well enough.

For example, August Bradley's pretty famous Notion PPV framework relies on the bedrock of formulas. He's never going to try out Tana for real when Notion offers a much more efficient workflow, along with relational databases and 'bidirectional relationships' among databases.

The difference between AI and formulas:

  • Formulas are free while AI costs a lot of tokens
  • Formulas offer far more control over the output with more predictable results
  • Formulas offer conditional loops (if/then, etc)
  • Formulas offer mathematical operations crucial for manipulating numbers on spreadsheets
  • Formulas are usually more "immediate" and do not require the clicking of a button to run - it's immediately reflected in realtime

I really like the AI thing going on, but sometimes the output can be quite unpredictable. Also, it's costly over time. And I'd love

There is apparently already a 'formula' field. When you type the 'Set formula' command on a field, it's value become a computed value build from the result of the functions that you added in this field.
I coulnd't find any documentation about that feature. I just found some functions like: sum, average, min, max,... and I only managed to add 'hardcoded' values as parameters to these functions. What we need now is to be able to add the value of another field instead of hardcoded values. There is maybe a way to do so but I couldn't find how....
Screenshot 2023-07-21 at 09.35.48.png

@Julien France I don't think it's quite the same. The thing that comes to mind when talking about formulas isn't just mathematical calculations, but a consistent, predictable output from an input. And this includes:

  • Concatenation of strings
  • If/then
  • formatting dates/other types as strings
  • getting character length
  • slicing strings at particular words
  • adding/subtracting dates
  • converting dates from hours to minutes to seconds, vice versa
  • true/false conditions

I am really feeling the need for something like this feature.

Airtable does this so well. They have very powerful formulas for working with fields, but also special fields they call "Rollups" and "Lookups" that allow you to work with the data contained in linked records (analogous to linked Nodes in Tana).

The note taking apps have a lack of this feature. I didn't saw to much implemented it.

Capacities implemented that feature in simple table not database one.
Notion have a similar one with database with formula but I think it's not implemented in the bes way.

I am still waiting for the application to finally be complete.

I think this feature would help for a significant part of the community involved.

In reply to Julien France Julien France

It looks like Tana does support more than simple fixed values via the "formula" method @Julien France pointed out; I did a bit more poking and was able to get some more out of it:

https://ktemk.in/post/tana-formulae/

Things formulas can do, from what I'm looking at, while live updating:

  • Use field values given anything you can craft a search query for (using e.g findInstance, filter, and lookup)
  • Use field values for a particular field in parent/child nodes
  • Use field values on any node that is used itself as a field value
  • Basic math (add, subtract, multiply, divide, average, min, max, count, rounding) on node contents / field values
  • Filter out duplicate references
  • Parse and format dates, to a degree
  • Get the first and last N items returned by a search
  • Combine disparate searches
  • Move up and down the parent/child tree
  • Count the length of a string or the number of emojis in it (???)

... and that's about it. There doesn't seem to be a way to get a substring, or choose based on conditions, or anything like that.

edit: now, if there was the ability to specify an arbitrary javascript function to run instead of these preselected few, that would be 🔥