Geotagging For Financial Intelligence

But now think of your expansions to this.

Next week, you want to add a tracker to see how many lessons each student is cancelling.

<$list filter="tag[lesson]get[student]unique[]sort[]" variable="student">
  <!-- do something with `<$list filter="[tag[lesson]student<student>lesson-status[no]]">` -->
</$list>

And soon after you want to incorporate a lesson calendar. You just use something like

<!-- with "date" given by some calendar plugin -->
<$list filter="[tag[lesson]lesson-date<date>sort[time]]" variable="lesson"> <!-- need to add `time` field -->
<% if [<lesson>lesson-status[no]] %>
  <<display-cancelled-lesson>>
<% else %>
  <<display-lesson>>
</$list>

And you can do so much more with these filters. Could you do it with your single title? Probably, but only with great difficulty, and with wikitext much harder to understand.


You also would probably need only the tag “lesson”; the rest are redundant and distracting. I see you use a month tag (2025-09). You could use the lesson-date field for the same sort of querying:

<!-- `month` looks like `2025-09` -->
[tag[lesson]] :filter[get[lesson-date]prefix<month>]

But if you used it extensively, there’s nothing to say you can’t have month and day fields instead, or year, month, and day ones. Any complex querying that might entail can easily be wrapped in functions.

That’s why we recommend fairly atomic fields.

1 Like

Very useful filters. New to me are the “unique[]” and “variable=""

unique is extremely useful; I use it all the time.

variable is not part of the filter syntax, but part of the $list widget. Because the current value is already available in currentTiddler, it’s most helpful in nested $list widgets, where you want to call back to outer lists. But there are at least two other reasons to use it. First, you might want to keep your currentTiddler value intact even inside another list. If you use variable, then currentTiddler is not overridden. Sometimes this is done with a throw-away variable (variable = "skip", variable = "_", etc.)

Second, I used it above basically to make it easier to read the code. This is often easier to understand:

<% if [<lesson>lesson-status[no]] %>

than this:

<% if [<currentTiddler>lesson-status[no]] %>

So we might introduce such a variable just for clarification purposes.

Be carful here with your definition of “Purpose”, in common language “the purpose” need not to map to good organisation.

Good organisation

One of the simplest and most powerful lessons I go in may career in IT was about database normalisation. By normalisation it means keeping data in a logical way without complications, compound values especialy, when the are in the key to the data are complications.

I belive tiddleywikis strength is the (primary) key to data is the title of the tiddler. Unlike other implementions this puts the key at eye level, in your face. When its always in your face why complicate it?

  • Further data in a field/column gives that data “an address”, made up of the title and the fieldname. ie it becomes directly addressable.

Consider this law of Database administration.

Data Should be related to the Key, the whole key and nothing but the key.

  • This means fields and their values should relate directly to the title or “key”.
  • This way we can see a set of tiddlers that belong to a group are in effect a table. Consider tiddlers with the tag contact (get the contact tiddlers caption of the plural “contacts”) this tag defines a table where each unique tiddler title defines a row in the contacts table, each field a column in that table, and the information in each row relates to the title (current contact) and nothing else.

As long as you always keep your data in tables it is very easy to organise and access your data.

  • The title is the only garenteed unique key in tiddlywiki and as such we should structure our data on this.
  • Sure you can find cases where you are not sure how to, but ask here because we have being dealing with it for years.
  • If you put compound values in a title you are in a sense turning the title into a table. Don’t do it.
  • With relink installed, if not by default, but by configuration, you can gaurentee “referential integrity”.

Referential Integrity | Definition, Types, Examples & Scope

AI Overview

Referential integrity is a database concept ensuring valid relationships between tables by guaranteeing that a foreign key in one table always points to a real primary key in another table, preventing “orphaned records” and maintaining data consistency. It is enforced by rules that restrict, cascade, or set null when a related record is updated or deleted, ensuring the database’s overall data accuracy and reliability

  • A foreign key is the title of another tiddler, stored in the current one eg; in text, a field or list field.
  • If you change the name in one place it should be reflected in all other places it is referenced.