Skip to content

Group a list of files according to their metadata

Grouped list of files by their metadata


After using a GROUP BY statement, results will be inside an object that looks like:
- {key: groupName; rows: ArrayOfDataColumns}

This means to refer to things in your TABLE/LIST after grouping, you should either use key, or rows.fieldName to access them.


List of files grouped by creation date:

FROM "10 Example Data/books"
GROUP BY file.cday


Join grouped values into a string rather than a list

LIST join(, " | ")
FROM "10 Example Data/books"
GROUP BY file.cday

Create a custom field using Flatten

After grouping, it's usually only possible to display a single set of value under each group heading. In order to display something more complex, FLATTEN can be used to create a custom value that remains available after the GROUP BY.

LIST rows.customValue
FROM "10 Example Data/books"
FLATTEN + " (" + author + ")" AS customValue
GROUP BY "**" + file.cday + "**"