Filtering

When your maps get large, it can be helpful to filter those topics that you’re specifically interested in. For example, you might want to highlight those topics with a due date in the next few days or those topics that were modified yesterday.

iThoughts has a powerful ‘query language’ that enables you to describe those topics you’re most interested in. This is based on a database querying language called SQL (Google for ‘sqlite where clause’)

Some example queries might be:

progress=100

shape like ‘Rectangle’

priority=1 and icon like ‘%smiley%’

…which I hope are reasonably self-explanatory?

Once you’ve described the topics you’re interested in, then you can either show or hide those topics (and/or the branches on which they live.) iThoughts will ‘dim out’ topics as appropriate.


When structuring your query, you need to know what values you can query for (and their type.) The following table gives you the field names/types.

Field Name Type Description
createdintegerThe date/time (unix) when the topic was created
modifiedintegerThe date/time (unix) when the topic was last modified
texttextThe topic text as displayed (NOT the markdown)
notetextThe topic note as displayed (NOT the markdown)
linktextThe link attached to a topic
shapeinteger
  • RectangleRounded=0
  • Rectangle=1
  • Ellipse=2
  • Line=3
  • None=4
  • SquareBracket=5
  • CurvedBacket=6
  • Circle=7
  • Diamond=8
  • Parallelogram=9
  • Pill=10
  • Square=11
  • Triangle=12
colortextThe RGB color of the topic (eg FF0000 for red)
iconstextComma delimited list of icon names
priorityintegerNumber from 1-5 (or -1 if not set)
progressintegerProgress from 0-100 (or -1 if not set)
startintegerThe START date/time (unix)
dueintegerThe DUE date/time (unix)
effortrealThe effort (in hours)
costrealThe cost
resourcestextComma delimited list of resource names

Querying for Text (text, notes, links, shapes, colors etc.)

When querying for textual values you should use LIKE. Where you want a wildcard match you can use %.

For example if you want to match on all topics that have a smiley then you would use the following:

icons like ‘%smile%’

The % matches on any characters. So in the above, any icons with smile in their name will be matched.

Querying for dates

Querying for dates is a little more complex - but very powerful. The following example will pull out all topics modified yesterday:

DATE(modified,'unixepoch','localtime') = DATE('now','-1 day','localtime')

DATE(modified,'unixepoch','localtime') extracts the modified date and adjusts it for daylight saving time. The ‘unixepoch’ tells the system what format the modified date is stored in (i.e. the number of seconds since 1970.)

DATE('now','-1 day','localtime') calculates the date for yesterday (now - 1day)

The two dates are then compared for equality.

Compound Queries

Individual queries can be strung together with AND or OR and NOT and nested with brackets. For example the following will pull out all topics DUE anytime before now+7days AND where their progress is not 100 (i.e. complete)

DATE(due,'unixepoch','localtime') <= DATE('now','+7 day','localtime') and progress != 100

Icon Names?

Each icon has a fixed ‘name’ (in English.) To determine the name:

  • On Mac/Windows, hover your mouse over the icon in the icon picker (a tooltip will tell you the name)

  • On iOS - TODO

Colors?

Colors are stored as RGB values.

  • On Mac/Windows, hover your mouse over the color in the color picker (a tooltip will tell you the value)

  • On iOS - TODO



Filtering is quite a complex beastie - but there is plenty on the internet regarding SQLite WHERE clauses - and you can alway email me…