Queries / Reporting Based on Tags

87 views
Skip to first unread message

Farayi Chambati

unread,
Nov 28, 2016, 1:53:36 AM11/28/16
to TiddlyWiki
Hi Guys,

A little help here!

I have  tiddler with following  tags.

Example: 1

Tiddler Title: App Idea suggested by Peter
Tag: priority:high, ios project, people:peter, department:marketing


Example 2:

Tiddler Title: Task to be completed  by John
Tag: priority:high, ios project, people:john, department:developmemt

The examples are just for illustration, in one file I could have different tags and tagging different things from facts, people, tasks, qoutes etc..

with these tiddlers I would like to produce a dynamic report with the following tabular structure:


Priorty   |  IOS Project                                      | People | Department
high        | App Idea suggested by Peter| Peter | marketing
high        | Task to be completed by John | John| develpment

I do not want to use fields as I want the stucture to be flexible without predefining the fields in advance. Tags give me this flexibility.

Many thanks in advance.



Mark S.

unread,
Nov 28, 2016, 11:23:25 AM11/28/16
to TiddlyWiki
But you ARE predefining fields still. You've just put the structure into tags where it will be difficult to parse out. "people:john" is the same as having a field "people" with a value "john".  It would be easier just to put john into field people where it can be fetched easily with {{!!people}}.

Good luck!
Mark

Jed Carty

unread,
Nov 28, 2016, 1:22:37 PM11/28/16
to TiddlyWiki
Mark is right, it would be much easier to do it with fields. What you have will actually be much much more harder to work with and expand upon in the future.

To do the whole thing with tags is possible, but is more complex that I feel like showing here. You can make something like this but you need one case for every possibility, this would just show the 'high' part from the priority column:

<$list filter=<<Some filter that will gather the tiddlers you want to list in the table>>>
<$list filter='[is[current]tag[priority:high]]'>high</$list>
<$list filter='[is[current]tag[priority:low]]'>low</$list>
</$list>

you would need to add something inside the list for every possibility for every column.

Otherwise you could just have fields and make the table display a column for each field and list the field contents. So if you have a field called priority it will show a column priority and you can put whatever you want in the field to be displayed for that column. Or if you know what columns you want Marks answer would do everything you need.

Farayi Chambati

unread,
Nov 28, 2016, 8:15:20 PM11/28/16
to TiddlyWiki
Thanks Mark and Jed,

You have given me a head start. However, I still need a bit of help:

I have come up with a query like



<<list-links filter:"[tag{!!priority}] +[tag{!!people]]">>

I get a list of Tiddlers meeting my criteria.  I would like to display more than a Title but other fields like:

Tiddler Title | Field 1| Field 2| etc..

How do I do that.

Mark S.

unread,
Nov 28, 2016, 9:57:23 PM11/28/16
to TiddlyWiki
The list-links will limit you to only a list of links. To build up more than that, try something like (untested):

<table>
<$list filter="[tag{!!priority}] +[tag{!!people]]">
<tr><td>
{{!!title}}</td><td> {{!!Field 1}}</td><td>{{!!Field 2}}</td><td> etc..
</td></tr>

</$list>
</table>

In my experience, building a table breaks down when you try to use pipes, so that's why I use HTML here.  But feel free to try.

Have fun,
Mark

Fatso Tutor

unread,
Nov 29, 2016, 4:42:51 AM11/29/16
to TiddlyWiki
Thanks Mark. I am set now
Reply all
Reply to author
Forward
0 new messages