Topic: The file.lists by example
- The file.lists by example - Chapter 4: using DQL(or DVJS) to gather list items or task items under the specific heading (and filter by L.text)(and filter by L.task or !L.task)(and filter by L.tags or L.outlinks) without(or with) the desired structure
Summary
- How to gather list items or task items under the specific heading without the desired structure?(
DQL10
,DQL20
,DQL30
,DQL40
,DQL50
) - How to gather list items or task items under the specific heading with the desired structure? (
DVJS10
)
Test
Summary
- dataview: v0.5.46
input
Summary
dictionary files:
- Location: “100_Project/02_dataview/Q82_header/Q82_test_data”
folder: 03_milestones
- filename :
dic_19890301
---
Date: 1989-03-01
---
#Project/P03
## input
### milestones
- 1989-03-01 add this feature_A #Test/d01 [[Note J]] , [[Note K]]
- 1989-03-02 add this feature_B #Test/d02 [[Note J]]
- 1989-03-03 add this feature_C [[Note K]]
- 1989-03-04 add this feature_D #Test/d04
### Question A
- [type:: "food"] [desc:: "breakfast"] [cost:: 10] #Test/d01 [[Note J]] , [[Note K]]
- [type:: "food"] [desc:: "breakfast"] [cost:: 20] #Test/d02 [[Note J]]
### Question B
- [type:: "food"] [desc:: "dinner"] [cost:: 30] [[Note K]]
- [type:: "food"] [desc:: "dinner"] [cost:: 40] #Test/d04
- (type:: "food") (desc:: "dinner") (cost:: 50) #Test/d05
- C1
- C2
- C3
folder: 04_tasks
- filename :
dic_19890401
---
Date: 1989-04-01
---
#Project/P04
## input
### tasks
- [ ] 1989-04-01 add this feature_a #Test/d01 [[Note P]] , [[Note Q]]
- [ ] 1989-04-02 add this feature_b #Test/d02 [[Note P]]
- [ ] 1989-04-03 add this feature_c [[Note Q]]
- [ ] 1989-04-04 add this feature_d #Test/d04
### Question A
- [ ] [type:: "food"] [desc:: "breakfast"] [cost:: 100] #Test/d01 [[Note P]] , [[Note Q]]
- [ ] [type:: "food"] [desc:: "breakfast"] [cost:: 200] #Test/d02 [[Note P]]
### Question B
- [ ] [type:: "food"] [desc:: "dinner"] [cost:: 300] [[Note Q]]
- [x] [type:: "food"] [desc:: "dinner"] [cost:: 400] #Test/d04
- [ ] (type:: "food") (desc:: "dinner") (cost:: 500) #Test/d05
- [ ] C1
- [ ] C2
- [ ] C3
folder: 07_milestones_empty
- filename :
dic_19890701
---
Date: 1989-07-01
---
#Project/P07
## input
### milestones
### Question A
### Question B
folder: 08_tasks_empty
- filename :
dic_19890801
---
Date: 1989-08-01
---
#Project/P08
## input
### tasks
### Question A
### Question B
DQL10_flatten_fLists_groupBy_L_header_and_TABLE
- To gather list items or task items under the specific heading where the heading contains “Question” without the desired structure
Summary
Main DQL
Code Name | Data type | Group By | Purposes | Remark |
---|---|---|---|---|
DQL10_flatten_fLists _groupBy_L_header _and_TABLE |
file.lists | yes | 1.To flatten file.lists 2.To define a field variable F_subpath 3.To define a field variable F_type 4.To gather list items or task items where the heading contains “Question” 5.To group by L.header 6.To display the result as a table [without the desired structure] |
The DQL10 is based on the DQL90 in the following topic. - Solutions: by Justdoitcc |
Code DQL10_flatten_fLists_groupBy_L_header_and_TABLE
Summary_code
title: DQL10_flatten_fLists_groupBy_L_header_and_TABLE =>
collapse: close
icon:
color:
```dataview
TABLE WITHOUT ID
map(rows.L, (L) => choice(L.task, "- [" + L.status + "] " + L.text, L.text)) AS "Texts",
rows.L.header[0] AS "Headers"
FROM "100_Project/02_dataview/Q82_header/Q82_test_data" AND #Project
FLATTEN file.lists AS L
FLATTEN meta(L.header).subpath AS F_subpath
FLATTEN meta(L.header).type AS F_type
WHERE contains(F_subpath, "Question") AND F_type = "header"
GROUP BY L.header
```
Screenshots(DQL10)
DQL20_flatten_fLists_groupBy_L_header_and_LIST
- To gather list items or task items under the specific heading where the heading contains “Question” without the desired structure
Summary
Main DQL
Code Name | Data type | Group By | Purposes | Remark |
---|---|---|---|---|
DQL20_flatten_fLists _groupBy_L_header _and_LIST |
file.lists | yes | 1.To flatten file.lists 2.To define a field variable F_subpath 3.To define a field variable F_type 4.To gather list items or task items where the heading contains “Question” 5.To group by L.header 6.To display the result as a list [without the desired structure] |
The DQL20 is based on the DQL10 in the topic. |
Code DQL20_flatten_fLists_groupBy_L_header_and_LIST
Summary_code
title: DQL20_flatten_fLists_groupBy_L_header_and_LIST =>
collapse: close
icon:
color:
```dataview
LIST
map(rows.L, (L) => choice(L.task, "- [" + L.status + "] " + L.text, L.text))
FROM "100_Project/02_dataview/Q82_header/Q82_test_data" AND #Project
FLATTEN file.lists AS L
FLATTEN meta(L.header).subpath AS F_subpath
FLATTEN meta(L.header).type AS F_type
WHERE contains(F_subpath, "Question") AND F_type = "header"
GROUP BY L.header
```
Screenshots(DQL20)
DQL30_flatten_fLists_groupBy_fLink_and_TABLE
- To gather list items or task items under the specific heading where the heading contains “Question” without the desired structure
Summary
Main DQL
Code Name | Data type | Group By | Purposes | Remark |
---|---|---|---|---|
DQL30_flatten_fLists _groupBy_fLink _and_TABLE |
file.lists | yes | 1.To flatten file.lists 2.To define a field variable F_subpath 3.To define a field variable F_type 4.To gather list items or task items where the heading contains “Question” 5.To group by file.link and let G_file_link = rows.file.link; 6.To sort by G_file_link in ascending order 7.To display the result as a table [without the desired structure] |
The DQL10 is based on the DQL90 in the following topic. - Solutions: by Justdoitcc |
Code DQL30_flatten_fLists_groupBy_fLink_and_TABLE
Summary_code
title: DQL30_flatten_fLists_groupBy_fLink_and_TABLE =>
collapse: close
icon:
color:
```dataview
TABLE WITHOUT ID
map(rows.L, (L) => choice(L.task, "- [" + L.status + "] " + L.text, L.text)) AS "Texts",
G_file_link AS "File"
FROM "100_Project/02_dataview/Q82_header/Q82_test_data" AND #Project
FLATTEN file.lists AS L
FLATTEN meta(L.header).subpath AS F_subpath
FLATTEN meta(L.header).type AS F_type
WHERE contains(F_subpath, "Question") AND F_type = "header"
GROUP BY file.link AS G_file_link
SORT G_file_link ASC
```
Screenshots(DQL30)
DQL40_flatten_fLists_groupBy_fLink_and_LIST
- To gather list items or task items under the specific heading where the heading contains “Question” without the desired structure
Summary
Main DQL
Code Name | Data type | Group By | Purposes | Remark |
---|---|---|---|---|
DQL40_flatten_fLists _groupBy_fLink _and_LIST |
file.lists | yes | 1.To flatten file.lists 2.To define a field variable F_subpath 3.To define a field variable F_type 4.To gather list items or task items where the heading contains “Question” 5.To group by file.link and let G_file_link = rows.file.link; 6.To sort by G_file_link in ascending order 7.To display the result as a list [without the desired structure] |
The DQL40 is based on the DQL30 in the topic. |
Code DQL40_flatten_fLists_groupBy_fLink_and_LIST
Summary_code
title: DQL40_flatten_fLists_groupBy_fLink_and_LIST =>
collapse: close
icon:
color:
```dataview
LIST
map(rows.L, (L) => choice(L.task, "- [" + L.status + "] " + L.text, L.text))
FROM "100_Project/02_dataview/Q82_header/Q82_test_data" AND #Project
FLATTEN file.lists AS L
FLATTEN meta(L.header).subpath AS F_subpath
FLATTEN meta(L.header).type AS F_type
WHERE contains(F_subpath, "Question") AND F_type = "header"
GROUP BY file.link AS G_file_link
SORT G_file_link ASC
```
Screenshots(DQL40)
DQL50_flatten_the_list_of_filtered_fLists_and_TABLE
- To gather list items or task items under the specific heading where the heading contains “Question” without the desired structure
Summary
Main DQL
Code Name | Data type | Group By | Purposes | Remark |
---|---|---|---|---|
DQL50_flatten_the_list _of_filtered_fLists _and_TABLE |
file.lists | no | 1.To flatten file.lists 2.To define an array variable QuestionA and To gather list items or task items where the heading is “Question A” 3.To define an array variable QuestionB and To gather list items or task items where the heading is “Question B” 4.To filter the data where QuestionA is not an empty array or QuestionB is not an empty array 5.To display the result as a table [without the desired structure] |
Code DQL50_flatten_the_list_of_filtered_fLists_and_TABLE
Summary_code
title: DQL50_flatten_the_list_of_filtered_fLists_and_TABLE =>
collapse: close
icon:
color:
```dataview
TABLE WITHOUT ID
map(QuestionA, (L) => choice(L.task, "- [" + L.status + "] " + L.text, L.text)) AS "Question A",
map(QuestionB, (L) => choice(L.task, "- [" + L.status + "] " + L.text, L.text)) AS "Question B",
file.link AS "File"
FROM "100_Project/02_dataview/Q82_header/Q82_test_data" AND #Project
FLATTEN list(filter(file.lists, (L) => meta(L.header).subpath = "Question A" AND meta(L.header).type = "header")) AS QuestionA
FLATTEN list(filter(file.lists, (L) => meta(L.header).subpath = "Question B" AND meta(L.header).type = "header")) AS QuestionB
WHERE QuestionA OR QuestionB
```
Screenshots(DQL50)
DVJS10_groupBy_fLink_groupIn_L_header_flatten_fLists_and_taskList
- To gather list items or task items under the specific heading where the heading contains “Question” with the desired structure
Summary
Main DVJS
Code Name | Data type | Group By | Purposes | Remark |
---|---|---|---|---|
DVJS10 _groupBy_fLink _groupIn_L_header _flatten_fLists _and_taskList |
file.lists | yes groupIn:yes |
1.To groupBy page.file.link as G1 (key=G1.key, values=G1.rows) 2.To flatten page.file.lists 3.To gather list items or task items under the heading where the heading contains “Question” 4.To groupIn groups_of_a_filtered_lists by L.header as G2 (key=G2.key, values=G2.rows) 5.To shorten each G2.key as s_header_without_fname 6.To output the data: 6.1 To display each G1.key page.file.link as a header (H3) 6.2 To display each shortened G2.key as a header (H4) 6.3 To display each G2.rows as a taskList [with the desired structure] |
The DVJS10 is based on the DVJS90 in the following topic. - Solutions: by Justdoitcc |
Notes
Summary
To modify the code
EX10: Original Example10
Summary_EX10
- WHERE_CASE_11: To gather list items or task items under the heading where the heading contains “Question”
// M31.FR13 define a_filtered_lists:
// FLATTEN_CASE_10:To FLATTEN page.file.lists and gather them:
// WHERE_CASE_11:To gather list items or task items under the heading where the heading contains "Question"
// (comments)WHERE_CASE_12_PART01:To gather a task item where it is not fullyCompleted
// (comments)WHERE_CASE_12_PART02:To gather a list item where L.text contains "breakfast"
// (comments)WHERE_CASE_13:To gather items where L.text contains "breakfast" or "dinner"
// (comments)WHERE_CASE_14_PART01:To gather items where L.tags contains "#Test/d05"
// (comments)WHERE_CASE_14_PART02:To gather items where L.outlinks contains "[[Note K]]"
// #####################################################################
let a_filtered_lists = G1.rows.flatMap((page) => page.file.lists)
.where(
(L) =>
dv.func.contains(L.header.subpath, "Question") &&
L.header.type === "header"
);
// .where(
// (L) =>
// (L.task && !L.fullyCompleted) ||
// (!L.task && dv.func.contains(L.text, "breakfast"))
// )
// .where(
// (L) =>
// dv.func.contains(L.text, "breakfast") ||
// dv.func.contains(L.text, "dinner")
// )
// .where(
// (L) =>
// dv.func.contains(L.tags, "#Test/d05") ||
// dv.func.contains(L.outlinks, dv.fileLink("Note K"))
// );
EX11: Another Example11
Summary_EX11
- WHERE_CASE_11: To gather list items or task items under the heading where the heading contains “Question”
- WHERE_CASE_13: To gather items where L.text contains “breakfast” or “dinner”
// M31.FR13 define a_filtered_lists:
// FLATTEN_CASE_10:To FLATTEN page.file.lists and gather them:
// WHERE_CASE_11:To gather list items or task items under the heading where the heading contains "Question"
// (comments)WHERE_CASE_12_PART01:To gather a task item where it is not fullyCompleted
// (comments)WHERE_CASE_12_PART02:To gather a list item where L.text contains "breakfast"
// WHERE_CASE_13:To gather items where L.text contains "breakfast" or "dinner"
// (comments)WHERE_CASE_14_PART01:To gather items where L.tags contains "#Test/d05"
// (comments)WHERE_CASE_14_PART02:To gather items where L.outlinks contains "[[Note K]]"
// #####################################################################
let a_filtered_lists = G1.rows.flatMap((page) => page.file.lists)
.where(
(L) =>
dv.func.contains(L.header.subpath, "Question") &&
L.header.type === "header"
)
// .where(
// (L) =>
// (L.task && !L.fullyCompleted) ||
// (!L.task && dv.func.contains(L.text, "breakfast"))
// )
.where(
(L) =>
dv.func.contains(L.text, "breakfast") ||
dv.func.contains(L.text, "dinner")
);
// .where(
// (L) =>
// dv.func.contains(L.tags, "#Test/d05") ||
// dv.func.contains(L.outlinks, dv.fileLink("Note K"))
// );
EX12: Another Example12
Summary_EX12
- WHERE_CASE_11: To gather list items or task items under the heading where the heading contains “Question”
- WHERE_CASE_12_PART01 or WHERE_CASE_12_PART02: To gather a task item where it is not fullyCompleted or To gather a list item where L.text contains “breakfast”
// M31.FR13 define a_filtered_lists:
// FLATTEN_CASE_10:To FLATTEN page.file.lists and gather them:
// WHERE_CASE_11:To gather list items or task items under the heading where the heading contains "Question"
// WHERE_CASE_12_PART01:To gather a task item where it is not fullyCompleted
// WHERE_CASE_12_PART02:To gather a list item where L.text contains "breakfast"
// (comments)WHERE_CASE_13:To gather items where L.text contains "breakfast" or "dinner"
// (comments)WHERE_CASE_14_PART01:To gather items where L.tags contains "#Test/d05"
// (comments)WHERE_CASE_14_PART02:To gather items where L.outlinks contains "[[Note K]]"
// #####################################################################
let a_filtered_lists = G1.rows.flatMap((page) => page.file.lists)
.where(
(L) =>
dv.func.contains(L.header.subpath, "Question") &&
L.header.type === "header"
)
.where(
(L) =>
(L.task && !L.fullyCompleted) ||
(!L.task && dv.func.contains(L.text, "breakfast"))
);
// .where(
// (L) =>
// dv.func.contains(L.text, "breakfast") ||
// dv.func.contains(L.text, "dinner")
// )
// .where(
// (L) =>
// dv.func.contains(L.tags, "#Test/d05") ||
// dv.func.contains(L.outlinks, dv.fileLink("Note K"))
// );
EX13A: Another Example13A
Summary_EX13A
- WHERE_CASE_11: To gather list items or task items under the heading where the heading contains “Question”
- WHERE_CASE_13: To gather items where L.text contains “breakfast” or “dinner” or “feature”
// M31.FR13 define a_filtered_lists:
// FLATTEN_CASE_10:To FLATTEN page.file.lists and gather them:
// WHERE_CASE_11:To gather list items or task items under the heading where the heading contains "Question"
// (comments)WHERE_CASE_12_PART01:To gather a task item where it is not fullyCompleted
// (comments)WHERE_CASE_12_PART02:To gather a list item where L.text contains "breakfast"
// WHERE_CASE_13:To gather items where L.text contains "breakfast" or "dinner" or "feature"
// (comments)WHERE_CASE_14_PART01:To gather items where L.tags contains "#Test/d05"
// (comments)WHERE_CASE_14_PART02:To gather items where L.outlinks contains "[[Note K]]"
// #####################################################################
let a_filtered_lists = G1.rows.flatMap((page) => page.file.lists)
.where(
(L) =>
dv.func.contains(L.header.subpath, "Question") &&
L.header.type === "header"
)
.where(
(L) =>
dv.func.contains(L.text, "breakfast") ||
dv.func.contains(L.text, "dinner") ||
dv.func.contains(L.text, "feature")
);
// .where(
// (L) =>
// dv.func.contains(L.tags, "#Test/d05") ||
// dv.func.contains(L.outlinks, dv.fileLink("Note K"))
// );
EX13B: Another Example13B
Summary_EX13B
- WHERE_CASE_11: To gather list items or task items under any heading
- WHERE_CASE_13: To gather items where L.text contains “breakfast” or “dinner” or “feature”
// M31.FR13 define a_filtered_lists:
// FLATTEN_CASE_10:To FLATTEN page.file.lists and gather them:
// WHERE_CASE_11:To gather list items or task items under any heading
// (comments)WHERE_CASE_12_PART01:To gather a task item where it is not fullyCompleted
// (comments)WHERE_CASE_12_PART02:To gather a list item where L.text contains "breakfast"
// WHERE_CASE_13:To gather items where L.text contains "breakfast" or "dinner" or "feature"
// (comments)WHERE_CASE_14_PART01:To gather items where L.tags contains "#Test/d05"
// (comments)WHERE_CASE_14_PART02:To gather items where L.outlinks contains "[[Note K]]"
// #####################################################################
let a_filtered_lists = G1.rows.flatMap((page) => page.file.lists)
.where(
(L) =>
//dv.func.contains(L.header.subpath, "Question") &&
L.header.type === "header"
)
.where(
(L) =>
dv.func.contains(L.text, "breakfast") ||
dv.func.contains(L.text, "dinner") ||
dv.func.contains(L.text, "feature")
);
// .where(
// (L) =>
// dv.func.contains(L.tags, "#Test/d05") ||
// dv.func.contains(L.outlinks, dv.fileLink("Note K"))
// );
EX14: Another Example14
Summary_EX14
- WHERE_CASE_11: To gather list items or task items under the heading where the heading contains “Question” with the desired structure
- WHERE_CASE_14_PART01 or WHERE_CASE_14_PART02: To gather items where L.tags contains “#Test/d05” or To gather items where L.outlinks contains “[[Note K]]”
// M31.FR13 define a_filtered_lists:
// FLATTEN_CASE_10:To FLATTEN page.file.lists and gather them:
// WHERE_CASE_11:To gather list items or task items under the heading where the heading contains "Question"
// (comments)WHERE_CASE_12_PART01:To gather a task item where it is not fullyCompleted
// (comments)WHERE_CASE_12_PART02:To gather a list item where L.text contains "breakfast"
// (comments)WHERE_CASE_13:To gather items where L.text contains "breakfast" or "dinner"
// WHERE_CASE_14_PART01:To gather items where L.tags contains "#Test/d05"
// WHERE_CASE_14_PART02:To gather items where L.outlinks contains "[[Note K]]"
// #####################################################################
let a_filtered_lists = G1.rows.flatMap((page) => page.file.lists)
.where(
(L) =>
dv.func.contains(L.header.subpath, "Question") &&
L.header.type === "header"
)
// .where(
// (L) =>
// (L.task && !L.fullyCompleted) ||
// (!L.task && dv.func.contains(L.text, "breakfast"))
// )
// .where(
// (L) =>
// dv.func.contains(L.text, "breakfast") ||
// dv.func.contains(L.text, "dinner")
// )
.where(
(L) =>
dv.func.contains(L.tags, "#Test/d05") ||
dv.func.contains(L.outlinks, dv.fileLink("Note K"))
);
code DVJS10_groupBy_fLink_groupIn_L_header_flatten_fLists_and_taskList : To get items where the heading contains “Question”
Summary_code
title: DVJS10_groupBy_fLink_groupIn_L_header_flatten_fLists_and_taskList => 1.To groupBy `page.file.link` as G1 (key=G1.key, values=G1.rows) 2.To flatten page.file.lists 3.To gather list items or task items under the heading where the heading contains "Question" 4.To groupIn `groups_of_a_filtered_lists` by `L.header` as G2 (key=G2.key, values=G2.rows) 5.To shorten each G2.key as `s_header_without_fname` 6.To output the data: 6.1 To display each G1.key `page.file.link` as a header (H3) 6.2 To display each shortened G2.key as a header (H4) 6.3 To display each G2.rows as a taskList [with the desired structure]
collapse: close
icon:
color:
```dataviewjs
// M11. define pages: gather all relevant pages
// #####################################################################
let pages = dv
.pages('"100_Project/02_dataview/Q82_header/Q82_test_data" and #Project')
//.where((page) => page.Areas)
//.sort((page) => page.file.name, "asc");
// M21. define groups:
// To groupBy page.file.link AS G1 (G1=group.rows)
// #####################################################################
let groups = pages
.groupBy((page) => page.file.link);
//.sort((group) => group.key, "desc");
// M31. output groups:
// #####################################################################
for (let G1 of groups) {
// M31.FR13 define a_filtered_lists:
// FLATTEN_CASE_10:To FLATTEN page.file.lists and gather them:
// WHERE_CASE_11:To gather list items or task items under the heading where the heading contains "Question"
// (comments)WHERE_CASE_12_PART01:To gather a task item where it is not fullyCompleted
// (comments)WHERE_CASE_12_PART02:To gather a list item where L.text contains "breakfast"
// (comments)WHERE_CASE_13:To gather items where L.text contains "breakfast" or "dinner"
// (comments)WHERE_CASE_14_PART01:To gather items where L.tags contains "#Test/d05"
// (comments)WHERE_CASE_14_PART02:To gather items where L.outlinks contains "\[[Note K]\]"
// #####################################################################
let a_filtered_lists = G1.rows.flatMap((page) => page.file.lists)
.where(
(L) =>
dv.func.contains(L.header.subpath, "Question") &&
L.header.type === "header"
);
// .where(
// (L) =>
// (L.task && !L.fullyCompleted) ||
// (!L.task && dv.func.contains(L.text, "breakfast"))
// )
// .where(
// (L) =>
// dv.func.contains(L.text, "breakfast") ||
// dv.func.contains(L.text, "dinner")
// )
// .where(
// (L) =>
// dv.func.contains(L.tags, "#Test/d05") ||
// dv.func.contains(L.outlinks, dv.fileLink("Note K"))
// );
// M31.FR15 check a_filtered_lists.length :
// #####################################################################
if (a_filtered_lists.length === 0){
continue;
}
// M31.FR21 output G1.key `page.file.link` as a header (H3)
// #####################################################################
dv.header(3, G1.key);
// M31.FR22 To groupIn groups_of_a_filtered_lists by L.header :
// (G2=group_L.rows)
// #####################################################################
let groups_of_a_filtered_lists = a_filtered_lists
.groupIn((L) => L.header);
// M31.FR22.FR10 : output groups_of_a_filtered_lists (Not To use groupByFile = true)
// It is the same as the code in the Step `M31.FR22.FR20`.
// The only difference is each `G2.key` that is displayed in the result.
// org:dic_19890301 > Question A(2)
// dv.taskList(tasks, groupByFile)
// #####################################################################
//dv.taskList(groups_of_a_filtered_lists, true);
//dv.span(groups_of_a_filtered_lists[0]); // debug_output
// M31.FR22.FR20 : output groups_of_a_filtered_lists (To use groupByFile = false)
// It is the same as the code in the Step `M31.FR22.FR20`.
// The only difference is each `G2.key` that is displayed in the result.
// new:Question A(2)
// #####################################################################
for (let G2 of groups_of_a_filtered_lists) {
// M31.FR22.FR20.TL13 : define QTY
// QTY:the quantity of each L.text in group_L.rows where L.header contains group_L.key
// G2.key: org(a link) :dic_19890301 > Question A
// #####################################################################
let QTY = G2.rows
.where((L) => dv.func.contains(L.header, G2.key))
.where((L) => L.text)
.length;
// M31.FR22.FR20.TL15 : define s_header_without_fname
// G2.key: org(a link) :dic_19890301 > Question A
// G2.key: new(a link + a string):Question A(QTY)
// #####################################################################
// The following is the content of the G2.key(L.header).
// {
// "path": "100_Project/02_dataview/Q82_header/Q82_test_data/dic_19890301.md",
// "type": "header",
// "subpath": "Question A"
// }
// let s_header_without_fname = G2.key.subpath + "("+ QTY +")";
let s_link = "[[" + G2.key.path + "#" + G2.key.subpath + "|" + G2.key.subpath + "]]";
let s_header_without_fname = s_link + "("+ QTY +")";
// M31.FR22.FR20.TL17 : output G2.key as a header (H4)
// G2.key: new(a link + a string):Question A(QTY)
// #####################################################################
dv.header(4, s_header_without_fname);
// M31.FR22.FR20.TL21 :
// output each L.text of G2.rows by dv.taskList(tasks, false)
// [with the desired structure]
// #####################################################################
dv.taskList(
G2.rows.where((L) =>
//(one link) :dic_19890301 > Question A
//(another link) :dic_19890301 > Question a
dv.func.contains(L.header, G2.key)
),
false
);
}
// M31.FR23 output a_filtered_lists.text: [with the desired structure]
// #####################################################################
//dv.taskList(a_filtered_lists, false);
}
```
Screenshots(DVJS10)
Part 1/2
Part 2/2
Conclusion
Summary
- There are at least six methods to gather list items or task items under the specific heading by using
file.lists
. - ONLY the
DVJS10
can display the desired structure. - ONLY the
DVJS10
can display the task status that can be toggled. In other words, you can toggle the status of a task from the result of theDVJS10
and the original task that you want to toggle will be marked as done.
Related resources
Summary
- The file.lists by example - Chapter 1: using DQL to gather list items or task items under the specific heading
- Problems: JonnyP: Grouping Tasks in Dataview by Content at 2022-08-23
- Solutions: by Justdoitcc
- The file.lists by example - Chapter 2 : using DVJS to gather list items or task items under the specific heading and group by a column (and group by another column)
- The file.lists by example - Chapter 3: using DQL to gather list items or task items under the specific heading (and filter by a field) (and sum up a field) (and display each DVIF)