Filtering by concatenation of few fields - need help

Hello, there.

Trying to use TW as a task tracker. Having few main types of tiddlers: day, week, sprint, event and task.

All of them have few user fields:

day_since, 
month_since, 
year_since, 
day_due, 
month_due, 
year_due.

For example,

the task will have fields:

day_due="01"
month_due="03"
year_due="2022"

the week will have fields:

day_since="21"
month_since="02"
year_since="2022"
day_due="27"
month_due="02"
year_due="2022"

I do not use date type for purpose - i use xx instead of numbers (cron-like style) for some events - like birthdays and holidays to be repeated every year, so i put xx instead of year number etc. I want to filter tasks to show all tasks, fitting into week duration - i have day, month and year both for start and end of the week andd need to build and expression how to shoow all fitting task on the week card.

Got stuck with searching the solution. I use tiddlywiki 5.2.1. Would appreciate any advices. Thanks in advance.

Welcome,

Could you give an example of what you want to concatenate, presumably a list of fields?

Hi and thank you.
Lets say, i have few tiddlers tagged as [task] with (user) fields like, i.e.
day_due=β€œ01” (or β€œ02” or smth)
month_due=β€œ03”
year_due=β€œ2022”

I also have tiddler tagged as [weel] which has set of fields like
day_since=β€œ28”
month_since=β€œ02”
year_since=β€œ2022”
day_due=β€œ06”
month_due=β€œ03”
year_due=β€œ2022”

Finally i want to build a filter, which brings me all tiddler, matching into week range, like that:

[year_due + month_due + day_due] of task
should be less or equal than
[year_due + month_due + day_due] of the week

the filter calculation result/render supposed to look like β€œ20220301” <= β€œ20220306” i.e.

I have found an artivle about subfilters and compare operator (Compare Operator, LessThan or Greater Than Macro) and looking for an approach how to concat filed values to use them into filter for comparison.

Try this;

\define week() {{!!year_due}}{{!!month_due}}{{!!day_due}}

<$wikify name=week text="""<<week>>""">
  <<week>> <!-- current tiddler-->    
</$wikify>

Untested but should work with the current tiddler.

However you can go directly in a filter
[all[current]get[year_due]] [all[current]get[month_due]] [all[current]get[day_due]] +[join[]]

<$set name=current-week value="[all[current]get[year_due]] [all[current]get[month_due]]  [all[current]get[day_due]]  +[join[]]">
<$set name=other-week value="[<other-tiddler>get[year_due]] [<other-tiddler>get[month_due]]  [<other-tiddler>get[day_due]]  +[join[]]">
compare here
</$set></$set>

Or something similar. I will return tomorrow as its bed time.

1 Like

I dont think it’s possible to get multiple fields from a list of tiddlers, concatenate the fields for each tiddler and compare the results with a value in only one filter run, so here’s how I would do it : (this code go into the tiddler β€œweek”)

<$let 
range_since={{{ [{!!year_since}] [{!!month_since}] [{!!day_since}]+[join[]]}}}
range_due={{{ [{!!year_due}] [{!!month_due}] [{!!day_due}]+[join[]]}}}
>
<$list filter="[tag[task]]">
{{{ 
[{!!year_due}] [{!!month_due}] [{!!day_due}]+[join[]]
+[compare:number:gteq<range_since>compare:number:lteq<range_due>then<currentTiddler>] 
}}}
</$list>
</$let>

task in range.json (1.3 KB)

1 Like

@TW_Tones , @telumire thanks a lot for your help, now i have exactly what i wanted!

2 Likes