Topic : 1/2
Summary
- How to extract the
Fund
orActionItem
via the fieldMonitoring
? (DQL01
,DQL10
,DVJS03
,DVJS10
) - How to filter by
Fund
orActionItem
via the fieldMonitoring
, such as “Monitoring:: FundQ | Do That0403”, from the Markdown files with thecase_DVIF_DSS
structure? (DQL10
,DVJS03
,DVJS10
) - How to transform the DQL10 query into a DVJS code with the FLATTEN methods step by step? (
DVJS10
, 【DQL10 > Notes > Q2】) - How to filter and sort an AoH(an Array of JavaScript Objects) and render a table via a DVJS code? (
DVJS01
)
NOTE:
- The DVJS01 can help you to figure out the basic DVJS code.
- The DVJS10 performs the same operations as the DQL10 with the FLATTEN methods step by step.
- The DVJS10 can help you to figure out the DQL10, including how to use the FLATTEN operator.
Structures: case_DVIF_DSS
Summary
DVIF = Dataview Inline Fields
Definitions:
Structure Code: case_DVIF_DSS
Definitions: Repeat in one file using one DVIF with at least one field separatorsDVIF: Use DVIF.
DSS: one DVIF with at least one field separatorsD: one DVIF
SS: field separators. Commonly used separators include " | ", ", ", and so on.
Data Structure: a list
Original Structure Code expressed in regular expressions: case_DVIF(_DSS){1,}
- Examples: Q06_Monitoring
- Exercises: Q79_SumOvertime, Q87_Event
Basic Example: use one DVIF, repeated in a file
NOTE:
use one DVIF, repeated in a file
one DVIFdrinks
with three field separators " | "
---
Date: 2022-06-01
---
%%Column Names: "item_name", "unit_price", "caffeine_content", "item_no"%%
drinks:: Black Coffee | 120 | 300 | IT001
drinks:: Green Tea | 100 | 200 | IT002
Basic Example: use one DVIF, not repeated in a file
NOTE:
use one DVIF, not repeated in a file
one DVIFdrinks
with three field separators " | "
---
Date: 2022-06-06
---
%%Column Names: "item_name", "unit_price", "caffeine_content", "item_no"%%
drinks:: Apple Juice | 110 | 0 | IT003
Notes:
Summary
Q1: What is the data structure of the file dic_20220403
?
Summary_Q1
Original Example: Q1 (To be explained)
NOTE:
- Take the following file
dic_20220403
as an example.- Each individual field
Monitoring
in the page is a string.- The field
Monitoring
, repeated in the page, is a list of strings.
---
Date: 2022-04-03
---
Monitoring:: FundQ | Do This0403
Monitoring:: FundQ | Do That0403
Monitoring:: FundP | Do Something Else0403
A1:
Another Example: A1_11
NOTE:
Before runningFLATTEN Monitoring AS OneMonitoring
, the fieldMonitoring
, repeated in the page, is an array of strings as shown below.
- Here is a slice of the
page
hash, wherepage.file.name
isdic_20220403
.
```JSON
[
{
date: "2022-04-03T00:00:00.000Z",
Monitoring: [
"FundQ | Do This0403",
"FundQ | Do That0403",
"FundP | Do Something Else0403",
],
file: {
name: "dic_20220403",
mtime: "2022-07-15T19:30:50.551Z",
},
},
]
```
Another Example: A1_12
NOTE:
After runningFLATTEN Monitoring AS OneMonitoring
, theMonitoring
in the page is an array of strings as shown below.
- Here is a slice of the
page
hash, wherepage.file.name
isdic_20220403
.
```JSON
[
{
date: "2022-04-03T00:00:00.000Z",
Monitoring: [
"FundQ | Do This0403",
"FundQ | Do That0403",
"FundP | Do Something Else0403",
],
OneMonitoring: "FundQ | Do This0403",
file: {
name: "dic_20220403",
mtime: "2022-07-15T19:30:50.551Z",
},
},
{
date: "2022-04-03T00:00:00.000Z",
Monitoring: [
"FundQ | Do This0403",
"FundQ | Do That0403",
"FundP | Do Something Else0403",
],
OneMonitoring: "FundQ | Do That0403",
file: {
name: "dic_20220403",
mtime: "2022-07-15T19:30:50.551Z",
},
},
{
date: "2022-04-03T00:00:00.000Z",
Monitoring: [
"FundQ | Do This0403",
"FundQ | Do That0403",
"FundP | Do Something Else0403",
],
OneMonitoring: "FundP | Do Something Else0403",
file: {
name: "dic_20220403",
mtime: "2022-07-15T19:30:50.551Z",
},
},
]
```
Q2: What is the data structure of the file dic_20220503
?
Summary_Q2
Original Example: Q2 (To be explained)
NOTE:
- Take the following file
dic_20220503
as an example.- The
Monitoring
in the page is a string.
```yaml
---
Date: 2022-05-03
---
Monitoring:: FundK | Do This0503
```
A2_21:
Another Example: A2_21
- Here is a slice of the
page
hash, wherepage.file.name
isdic_20220503
.
```JSON
[
{
date: "2022-05-03T00:00:00.000Z",
Monitoring: "FundK | Do This0503",
file: {
name: "dic_20220503",
mtime: "2022-07-15T14:28:31.993Z",
},
},
]
```
Test
Summary
- dataview: v0.5.55
Input
Summary
dictionary files
- Location: “100_Project/02_dataview/Q06_Monitoring/Q06_test_data”
folder: 03
- filename :
dic_20220303
---
Date: 2022-03-03
---
Monitoring:: FundA | Do This0303
Monitoring:: FundA | Do That0303
Monitoring:: FundB | Do Something Else0303
- filename :
dic_20220308
---
Date: 2022-03-08
---
Monitoring:: FundM | Do This0308
Monitoring:: FundM | Do That0308
Monitoring:: FundN | Do Something Else0308
folder: 04
- filename :
dic_20220403
---
Date: 2022-04-03
---
Monitoring:: FundQ | Do This0403
Monitoring:: FundQ | Do That0403
Monitoring:: FundP | Do Something Else0403
- filename :
dic_20220408
---
Date: 2022-04-08
---
Monitoring:: FundR | Do This0408
Monitoring:: FundR | Do That0408
Monitoring:: FundS | Do Something Else0408
folder: 05_string
- filename :
dic_20220503
---
Date: 2022-05-03
---
Monitoring:: FundK | Do This0503
- filename :
dic_20220508
---
Date: 2022-05-08
---
Monitoring:: FundJ | Do Something Else0508
folder: 09_null
- filename :
dic_20220903
---
Date: 2022-09-03
---
Monitoring::
- filename :
dic_20220908
---
Date: 2022-09-08
---
Monitoring::
Monitoring::
folder: 10_undefined
- filename :
dic_20221003
---
Date: 2022-10-03
---
DQL01_split_up_a_list_into_each_individual_element_via_FLATTEN_and_TABLE
Summary
Main DQL
Code Name | Data type | Purposes | Remark |
---|---|---|---|
DQL01 _split_up_a_list _into_each_individual_element _via_FLATTEN _and_TABLE |
Monitoring :1.a string 2.a list of strings OneMonitoring :a string 1.“Monitoring:: FundQ | Do That0403” |
1.To filter by Monitoring 2.To sort by file.name in ascending order 3.To split up a list Monitoring into each individual element OneMonitoring 4.To filter by OneMonitoring 5.To display the result as a table 5.1 To output the Fund1 from the OneMonitoring 5.2 To output the ActionItem1 from the OneMonitoring |
Note: Require the files with the case_DVIF_DSS structure |
Notes
Summary
Q1: How to get the s_page.Fund_DQL
and s_page.ActionItem_DQL
from the s_page.Monitoring
via Inline DQL?
Summary_Q1
A1_11:
b_string_splited: Finished!
```md
aMonitoring=["FundA | Do This", "FundA | Do That"]
sMonitoring="FundA | Do This"
// /\s+\|\s+/
// ==>The spaces beside the "|" will be found and removed with "|" by `split`.
b_string_splited=`=split("FundA | Do This", "\s+\|\s+")`
//=>FundA, Do This
```
s_page.Fund_DQL: Finished!
```md
s_page.Fund=`=split("FundA | Do This", "\s+\|\s+")[0]`
//=>"FundA"
s_page.Fund_DQL=`split(Monitoring, "\s+\|\s+")[0]`
//=>【The DQL expression is Finished!】
```
s_page.ActionItem_DQL: Finished!
```md
s_page.ActionItem=`=split("FundA | Do This", "\s+\|\s+")[1]`
//=>"Do This"
s_page.ActionItem_DQL=`split(Monitoring, "\s+\|\s+")[1]`
//=>【The DQL expression is Finished!】
```
Q2: How to get the file.path
of the page [[dic_20220303]] via Inline DQL?
Code DQL01_split_up_a_list_into_each_individual_element_via_FLATTEN_and_TABLE
Summary_code
title: DQL01_split_up_a_list_into_each_individual_element_via_FLATTEN_and_TABLE =>0.Require the files with the `case_DVIF_DSS` structure 1.To filter by `Monitoring` 2.To sort by `file.name` in ascending order 3.To split up a list `Monitoring` into each individual element `OneMonitoring` 4.To filter by `OneMonitoring` 5.To display the result as a table 5.1 To output the `Fund1` from the `OneMonitoring` 5.2 To output the `ActionItem1` from the `OneMonitoring`
collapse: close
icon:
color:
```dataview
TABLE WITHOUT ID
file.link AS "File",
Monitoring AS "Original Monitoring",
OneMonitoring AS "One Monitoring",
split(OneMonitoring, "\s+\|\s+")[0] AS "Fund1",
split(OneMonitoring, "\s+\|\s+")[1] AS "ActionItem1"
FROM "100_Project/02_dataview/Q06_Monitoring/Q06_test_data"
WHERE Monitoring != null
SORT file.name ASC
FLATTEN Monitoring AS OneMonitoring
WHERE OneMonitoring != null
```
Screenshots(DQL01)
Part 1/2:
Part 2/2:
DVJS01_example_filter_sort_AoH_and_TABLE
Summary
Main DVJS
Code Name | Data type | Purposes | Remark |
---|---|---|---|
DVJS01 _example _filter _sort_AoH _and_TABLE |
aoh_drinks :an Array of Hashes |
1.To filter by h_drink.item_name 2.To filter by h_drink.unit_price 3.To filter by h_drink["caffeine content"] 4.To sort by h_drink.item_name 5.To display the result as a table |
NOTE: 1.The prefix “AoH” of the variable aoh_drinks means an Array of Hashes.2.The Hashes means JavaScript Objects in the topic. |
Code DVJS01_example_filter_sort_AoH_and_TABLE
Summary_code
title: DVJS01_example_filter_sort_AoH_and_TABLE=>1.To filter by `h_drink.item_name` 2.To filter by `h_drink.unit_price` 3.To filter by `h_drink["caffeine content"]` 4.To sort by `h_drink.item_name` 5.To display the result as a table
collapse: close
icon:
color:
```dataviewjs
// D21.define : aoh_drinks
// AoH = an Array of Hashes = an Array of JavaScript Objects
// #####################################################################
let aoh_drinks = [
{ item_name: "Black Coffee", unit_price: 120, "caffeine content": 300, item_no: "IT001" },
{ item_name: "Green Tea", unit_price: 100, "caffeine content": 200, item_no: "IT002" },
{ item_name: "Apple Juice", unit_price: 110, "caffeine content": 0, item_no: "IT003" },
{ item_name: "Iced Chocolate", unit_price: 130, "caffeine content": 0, item_no: "IT004" },
{ item_name: "Hot Chocolate", unit_price: 105, "caffeine content": 0, item_no: "IT005" },
];
// D23. transform aoh_drinks :
// transform JavaScript arrays to Dataview Data Arrays in order to sort it
// #####################################################################
aoh_drinks = dv.array(aoh_drinks);
// D31. filter + sort aoh_drinks:
// #####################################################################
aoh_drinks = aoh_drinks
.filter(
(h_drink) =>
dv.func.contains(h_drink.item_name, "Coffee") ||
dv.func.contains(h_drink.item_name, "Tea") ||
dv.func.contains(h_drink.item_name, "Juice") ||
dv.func.contains(h_drink.item_name, "Chocolate")
)
.filter((h_drink) => h_drink.unit_price > 90 && h_drink.unit_price < 125)
.filter((h_drink) => h_drink["caffeine content"] >= 0)
.sort((h_drink) => h_drink.item_name, "asc");
// D51. render a tables : aoh_drinks
// #####################################################################
dv.header(5, "D51. Render a table: `aoh_drinks`");
dv.table(
["N", "Item Name", "Unit Price", "Caffeine Content", "Item No"],
aoh_drinks.map((dictionary, index) => [
index + 1,
dictionary.item_name,
dictionary.unit_price,
dictionary["caffeine content"],
dictionary.item_no,
])
);
```
Screenshots(DVJS01)
DVJS03_split_up_a_list_into_each_individual_element_and_filter_and_TABLE
NOTE:
- The DVJS03 performs the same operations as the DQL10.
- The DVJS03 is mainly used for the files with the
case_DVIF_DDD
structure.
Summary
Main DVJS
Code Name | Data type | Purposes | Remark |
---|---|---|---|
DVJS03 _split_up_a_list _into_each_individual_element _and_filter _and_TABLE |
Monitoring :1.a string 2.a list of strings OneMonitoring :a string 1.“Monitoring:: FundQ | Do That0403” |
The DVJS03 performs the same operations as the DQL10. | Note: Require the files with the case_DVIF_DDD (or case_DVIF_DSS ) structure |
Code DVJS03_split_up_a_list_into_each_individual_element_and_filter_and_TABLE
Summary_Code
title: DVJS03_split_up_a_list_into_each_individual_element_and_filter_and_TABLE =>0.Require the files with the `case_DVIF_DDD`(or `case_DVIF_DSS`) structure 1.The DVJS03 performs the same operations as the DQL10.
collapse: close
icon:
color:
```dataviewjs
// M11. define pages: get pages from Sources (M11, M15)
// #####################################################################
let pages = dv
.pages('"100_Project/02_dataview/Q06_Monitoring/Q06_test_data"')
.where((page) => page.Monitoring !== null && page.Monitoring !== undefined);
// M23. split up a list `Monitoring` into each individual element `OneMonitoring`
// update pages: add a new field `Fund` into each page
// update pages: add a new field `ActionItem` into each page
//
// define a JavaScript array
// #####################################################################
let dictionaries = [];
for (let page of pages) {
// M23.IF01: Classify '[object Object]' into '[object Array]' and '[object notArray]'
// #####################################################################
let sObjectType = "";
if (dv.isArray(page.Monitoring)) {
sObjectType = "[object Array]";
} else {
sObjectType = "[object notArray]";
}
// M23.IF02: define page.Monitoring a JavaScript array + Redefine sObjectType
// #####################################################################
if (sObjectType === "[object notArray]") {
page.Monitoring = [page.Monitoring];
sObjectType = "[object Array]";
}
// M23.EL03: transform the data when page.Monitoring is a JavaScript array
// #####################################################################
for (let i = 0; i < page.Monitoring.length; i++) {
let OneMonitoring = page.Monitoring[i];
// When OneMonitoring is not defined
// Use Case: dic_20221003
// #####################################################################
let aSplitOneMonitoring = ["", ""];
if (OneMonitoring) {
aSplitOneMonitoring = OneMonitoring.split(/\s+\|\s+/);
}
dictionaries.push({
file: page.file,
date: page.date,
OneMonitoring: OneMonitoring,
Fund: aSplitOneMonitoring[0],
ActionItem: aSplitOneMonitoring[1],
});
}
}
// M24. transform dictionaries:
// transform JavaScript arrays to Dataview Data arrays in order to sort it
// #####################################################################
dictionaries = dv.array(dictionaries);
// M25. sort by dictionary.Fund in ascending order: M99.(at the bottom)
// M31. filter by dictionary.Fund
// M33. filter by dictionary.ActionItem
// #####################################################################
dictionaries = dictionaries
.sort((dictionary) => dictionary.Fund, "asc")
.filter((dictionary) => dv.func.contains(dictionary.Fund, "FundQ"))
.filter((dictionary) => dv.func.contains(dictionary.ActionItem, "That"));
// M41. render a table: dictionaries
// #####################################################################
dv.header(5, "M41. Render a table: `dictionaries`");
dv.table(
["N", "File", "Monitoring", "Fund", "Action Item"],
dictionaries.map((dictionary, index) => [
index + 1,
dictionary.file.link,
dictionary.OneMonitoring,
dictionary.Fund,
dictionary.ActionItem,
])
);
```
Screenshots(DVJS03)
Explanation: the DVJS03
Summary
Overview
Main variables
- The following table presents the main variables in the DVJS03.
- a Hash = an JavaScript Object
Variables | Data type | Lifetime | Declared by | Remark |
---|---|---|---|---|
pages |
Array | When the code is completed | let | AoH = an Array of Hashes |
page |
Hash | In the {} curly brackets | ||
dictionaries |
Array | When the code is completed | let | AoH = an Array of Hashes |
dictionary |
Hash | In the {} curly brackets |
The data structure of the pages
- The
pages
array consists of eachpage
hash. - The
page
ispages[i]
, where i=0, …,pages.length-1
.
The data structure of the page
- Take the
dic_20220303
file for example. - filename :
dic_20220303
---
Date: 2022-03-03
---
Monitoring:: FundA | Do This0303
Monitoring:: FundA | Do That0303
Monitoring:: FundB | Do Something Else0303
- The plain
page
hash from a file is created by thedv.pages()
function and consists of three hashes : thepage.file
hash, the YAML fields and the Dataview inline fields. - Here is a slice of the
page
hash, wherepage.file.name
isdic_20120919
. - At Step M23, the following hash is transformed into two hashes, which are stored in the
dictionaries
array.
```JSON
{
file: {
name: 'dic_20220303',
ctime: '2022-03-03T19:30:50.586+08:00',
},
date: '2022-03-03T00:00:00.000+08:00',
Monitoring: ['FundA | Do This0303', 'FundA | Do That0303', 'FundB | Do Something Else0303'],
}
```
Step M11: Sources
- 【M11】: Suppose that there are many files located in the path
100_Project/02_dataview/Q06_Monitoring/Q06_test_data
.
- 【M15】: Suppose that the file where
page.Monitoring
does not strictly equal null and undefined is to be taken into consideration.
- Here is the code.
```dataviewjs
// M11. define pages: get pages from Sources (M11, M15)
// #####################################################################
let pages = dv
.pages('"100_Project/02_dataview/Q06_Monitoring/Q06_test_data"')
.where((page) => page.Monitoring !== null && page.Monitoring !== undefined);
```
Step M23: Split up
- 【M23】: Split up multiple group Dataview inline fields in the file into individual groups. (
pages
,page
==>dictionaries
,dictionary
) - Now let’s transform from thing per date (we have single page for each date) into thing per dictionary (we want to have as many rows in a table as all dictionaries extracted from all pages).
- The
dictionary
is a new row(hash) which consists of five fields sush aspage.file
,page.date
,page.Monitoring
,page.Fund
,andpage.ActionItem
. - The
dictionaries
is a new table(array), which consists of eachdictionary
row(hash).
Take the dic_20220303
for example:The Monitoring
is an array
- file name :
dic_20220303
---
Date: 2022-03-03
---
Monitoring:: FundA | Do This0303
Monitoring:: FundA | Do That0303
Monitoring:: FundB | Do Something Else0303
- There is ==more== than one
Monitoring
in the originalpage
file.
the original data structure
-
The plain
page
hash from a file is created by thedv.pages()
function and consists of three hashes : thepage.file
hash, the YAML fields and the Dataview inline fields. -
At Step M23, the following hash is transformed into three hashes, which are stored in the
dictionaries
array. -
Here is a slice of the
page
hash from thedic_20220303
file.
```JSON
{
file: {
name: 'dic_20220303',
ctime: '2022-03-03T19:30:50.586+08:00',
},
date: '2022-03-03T00:00:00.000+08:00',
Monitoring: ['FundA | Do This0303', 'FundA | Do That0303', 'FundB | Do Something Else0303'],
}
```
- The
page
hash is transformed into three new hashes as follows.
the new data structure
- The
dictionaries
array consists of eachdictionary
hash. - The plain
dictionary
hash is created from thepages
at Step M23 and consists of three hashes : thepage.file
hash, the YAML fields and the Dataview inline fields. - At Step M23, the following hashes are created from the above
page
hash. - Here’s one
dictionary
hash, which thedictionaries
array consists of.
```JSON
{
file: {
name: 'dic_20220303',
ctime: '2022-03-03T19:30:50.586+08:00',
},
date: '2022-03-03T00:00:00.000+08:00',
Monitoring: 'FundA | Do This0303',
Fund: 'FundA'
ActionItem: 'Do This0303'
}
```
- Here’s another
dictionary
hash, which thedictionaries
array consists of.
```JSON
{
file: {
name: 'dic_20220303',
ctime: '2022-03-03T19:30:50.586+08:00',
},
date: '2022-03-03T00:00:00.000+08:00',
Monitoring: 'FundA | Do That0303',
Fund: 'FundA'
ActionItem: 'Do That0303'
}
```
- Here’s the other
dictionary
hash, which thedictionaries
array consists of.
```JSON
{
file: {
name: 'dic_20220303',
ctime: '2022-03-03T19:30:50.586+08:00',
},
date: '2022-03-03T00:00:00.000+08:00',
Monitoring: 'FundB | Do Something Else0303',
Fund: 'FundB'
ActionItem: 'Do Something Else0303'
}
```
Step M24: transform JavaScript arrays to Dataview Data arrays
```dataviewjs
// M24. transform dictionaries:
// transform JavaScript arrays to Dataview Data arrays in order to sort it
// #####################################################################
dictionaries = dv.array(dictionaries);
```
Step M25: sort by dictionary.Fund
- 【M25】: Sort the
dictionaries
array by thedictionary.Fund
in ascending order.
Step M31: filter by dictionary.Fund
- 【M31】: Suppose that the row where
dictionary.Fund
includes “FundQ” is to be taken into consideration. - 【M33】: Suppose that the row where
dictionary.ActionItem
includes “That” is to be taken into consideration. - Here is the code.
```dataviewjs
// M25. sort by dictionary.Fund in ascending order: M99.(at the bottom)
// M31. filter by dictionary.Fund
// M33. filter by dictionary.ActionItem
// #####################################################################
dictionaries = dictionaries
.sort((dictionary) => dictionary.Fund, "asc")
.filter((dictionary) => dv.func.contains(dictionary.Fund, "FundQ"))
.filter((dictionary) => dv.func.contains(dictionary.ActionItem, "That"));
```
Step M41: TABLE
- 【M41】: Display each of the list as a table.
```javascript
[
index + 1,
dictionary.file.link,
dictionary.Monitoring,
dictionary.Fund,
dictionary.ActionItem,
]
```
- Here is the code.
```dataviewjs
// M41. render a table: dictionaries
// #####################################################################
dv.header(5, "M41. Print a table of the `dictionaries`");
dv.table(
["N", "File", "Monitoring", "Fund", "Action Item"],
dictionaries.map((dictionary, index) => [
index + 1,
dictionary.file.link,
dictionary.Monitoring,
dictionary.Fund,
dictionary.ActionItem,
])
);
```
Example: Get each name from an AoH
```md
a_Drinks=`$=
[
{ item_name: "Black Coffee", unit_price: 120, "caffeine content": 300, item_no: "IT001" },
{ item_name: "Green Tea", unit_price: 100, "caffeine content": 200, item_no: "IT002" },
{ item_name: "Apple Juice", unit_price: 110, "caffeine content": 0, item_no: "IT003" },
{ item_name: "Iced Chocolate", unit_price: 130, "caffeine content": 0, item_no: "IT004" },
{ item_name: "Hot Chocolate", unit_price: 105, "caffeine content": 0, item_no: "IT005" },
]
.map((e) => e["item_name"])
`
//=>Black Coffee, Green Tea, Apple Juice, Iced Chocolate, Hot Chocolate
```
Conclusion
Summary
- Only by knowing how to use the
FLATTEN
operator can many complex problems be simplified. - It is recommended to try to read the entire documentation, not just the DQL10 query.
Reference
Summary
DVIF Structures
Q06_Monitoring: case_DVIF_DSS
Q79_SumOvertime: case_DVIF_DSS
- Q79_SumOvertime: Solutions
Q87_Event: case_DVIF_DSS
- Q87_Event: Solutions
Q05_Schedule: case_DVIF_DSS
- How to split up multiple group Dataview inline fields in the file into individual groups?
- Using the DQL FLATTEN: mikael: Manage date/milestones using dataview on 2022-06-29
- Structures:
```md
---
Date: 2020-05-01
---
Schedule:: Release of Z6 book 2020-05-14
```
OR
```md
---
Date: 2020-03-01
---
Schedule:: Release of J1 book 2020-06-15
Schedule:: Release of K1 book 2020-03-08
```
Q01_TermDefinition: case_DVIF_DDD
- How to split up multiple group Dataview inline fields in the file into individual groups?
- Using the DVJS code based on the DVJS03: Luis_Aldama92: DataviewJS Snippet Showcase 162 on 2022-04-25 , Luis_Aldama92: DataviewJS Snippet Showcase 155 on 2022-04-16
- Structures:
```md
---
date: 2012-09-22
---
term:: "Name of Term W1"
definition:: "Definition of Term W1"
```
OR
```md
---
date: 2012-09-19
---
term:: "Name of Term A1"
definition:: "Definition of Term A1"
term:: "Name of Term Z1"
definition:: "Definition of Term Z1"
```
Q02_Meals: case_DVIF_DDD
- How to split up multiple group Dataview inline fields in the file into individual groups?
- Using the DVJS code based on the DVJS03 : lexane: DataviewJS Snippet Showcase 115 on 2022-07-21
- Structures:
```md
---
date: 2018-04-01
---
typerepas:: "meal type J"
heurerepas:: "hour meal J"
faimavantrepas:: "before hunger J"
repas:: "meal J"
faimapresrepas:: "after hunger J"
```
OR
```md
---
date: 2018-03-01
---
typerepas:: "meal type M"
heurerepas:: "hour meal M"
faimavantrepas:: "before hunger M"
repas:: "meal M"
faimapresrepas:: "after hunger M"
typerepas:: "meal type E"
heurerepas:: "hour meal E"
faimavantrepas:: "before hunger E"
repas:: "meal E"
faimapresrepas:: "after hunger E"
```
case_DVIF_DDD
- How to split up multiple group Dataview inline fields in the file into individual groups?
- Using the DVJS code based on the DVJS03 :BobWCB: How to generate multiple rows for records within one file? #1090 on 2022-05-15
- Structures:
```md
---
date: 2022-03-01
---
%%record_1%%
field1:: value01
field2:: value02
field3:: value03
%%record_2%%
field1:: value10
field2:: value20
field3:: value30
```
YAML Structures
Q17_Purchases: case_YAML_Y-YYY
- Q17_Purchases: Solutions
Q27_ProjectPerson: case_YAML_Y_AoH
- Q27_ProjectPerson: Solutions
FLST Structures
Q92_FileLists
- Q92_FileLists: Solutions
- Q92_FileLists: Input only
Q: How to use the file.lists data to design a Markdown file as a table in the database, where each record consists of multiple columns?
Answers
- There are at least four methods to do that by using the file.lists data.
Code Name | Data type | Structures | Headings(list items) | Headings(task items) | Remark |
---|---|---|---|---|---|
DQL61 | file.lists | case_FLST_HLDDD | what happened today | what happened today | |
DQL63 | file.lists | case_FLST_HLDDD | what happened today | what happened today | |
DQL65 | file.lists | case_FLST_HLDDD | what happened today | what happened today | |
DQL30 | file.lists | case_FLST_HLDSS | other events | other tasks | |
DQL20 | file.lists | case_FLST_HLSSS | some events | some tasks | |
DQL10 | file.lists | case_FLST_HLSS | milestones | main tasks |
Q18_QAA: case_FLST_LD-DDD
- Q18_QAA: Solutions_S1