Retrieving Lowest Number in a list

I’m trying to average the track times of my die-cast cars into a Table.

My Metadata is formatted as…

Time:

  • 3.00
  • 5.22
  • 2.00
  • 3.50

I was attempting to retrieve the information using…

Table
(min(Time)) AS “Fastest Time”

The file does not come up in the Query for some reason.

Unfortunately, i have not been able to find much info about how to work with Yaml List.

any help in this matter would be Much appreciated.

Hmm… Are you sure your YAML is properly formatted?

Try the following in an empty file:

---
Time:
  - 3.00
  - 5.22
  - 2.00
  - 3.50
---
```dataview
table without id time, min(time)
where file.name = this.file.name
```

For me this produces the output of:
image

As expected, this is a table with just one row where the values in the first column is the list of all values, and the second column is the minimum value of the list.

To give further assistance we would need a little more information such as the use case or what you’re intending to do, and what is your base data for doing so.

Bonus tip: To properly show code blocks in a forum post, enclose the entire section within code fences of more than three backticks, like four backticks, ````, before and after the section you want to display.

So, I have a Different file for each Car with the following header

---
Tags:
Alias:

Cost:

Weight: 30
Time:
- 3.00
- 5.22
- 2.00
- 3.50

Wins:
Loses:

Color: White
Collectors Number: 30
Series: Example
Series Number: 1/5
---

Then a file that has the Data view query as follows.

```dataview
Table
	min(time) AS "Fastest Time",
	Weight,
	(round(20/(Time), 2)) AS "ft/s",
	Color,
	Series
from "03 Research/Die-cast Cars"
```

I don’t get any errors from either my Header or the Query.

I copied the Query

```dataview
table without id time, min(time)
where file.name = this.file.name
```

and pasted it directly into my test file and it works when both the Metadata and Query are in the same file.

it might have to do with the “Where” expression. i dont have that defined in my query.

HeHe… That limit the query to only match that file, very useful when testing stuff… My bad for not removing it, or commenting upon that.

```dataview
table time, min(Time), file.folder
where time
```

This minimum query shows all files in the entire vault having a time field, and the minimum of that field if possible. With an addition of the source folder of the corresponding file.

What does this query show in your case?

We seem to be making Progress.

When i add

from "03 Research/Die-cast Cars"

it breaks it.

It should work even if you just specify a folder higher up in the hierarchy. At least it does so for me. Are you sure there aren’t any strange typos in there?

Try copy-paste from the file.folder column, and back into the from "..." statement. See if that helps.

i took my one test file and put it in its own folder, then directed My query to that folder.

i get this error

Dataview: Every row during final data extraction failed with an error; first 3:

            - No implementation found for 'number / array'

It seems to be working now. i’m not sure what i did to fix it though.

In this column assignment Time can be the entire array (or list) of times from that file. So depending on whether you’ve got any group by or flatten spread out elsewhere in the query, this might trigger that number / array error.

One way around that could be to use 20 / min(time) if it’s to be used for only that value. Other variants depend on the rest of your query.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.