Help understanding random() effect on bases views

What I’m trying to do and what I’ve tried

I have a base for all my notes. I’m using Tiago Forte’s progressive summarization, with some modifications. This is my base: it looks for any note that is in my summarization workflow. I’ve removed some of the views for simplicity.

filters:
  not:
    - file.path.startsWith("01 - Projects")
    - file.path.startsWith("Templates")
    - file.path.startsWith("Archive")
    - type == "Daily Note"
    - type == "Weekly Note"
    - type == "Monthly Note"
    - type == "Quarterly Note"
    - type == "Yearly Note"
    - file.path.startsWith("02 - Areas/+ 02 Weekly Notes/Weekly Archives")
views:
  - type: table
    name: All Notes
    groupBy:
      property: summary_progress
      direction: ASC
  - type: table
    name: L1
    filters:
      and:
        - summary_progress == "L1_Notes"
  - type: table
    name: None
    filters:
      and:
        - summary_progress.isEmpty()

I want to create a dashboard to work through my notes. I want to limit the number of visible notes to 10-15 per view, but I want them to be randomized whenever the table updates.

Whenever I add the random function, it does nothing.

  - type: table
    name: None
    filters:
      and:
        - summary_progress.isEmpty()
        - random()
    limit: 10

Or, if I add the random() function with a ratio it says I have less notes than I did without the function in. And the number changes based on the decimal I use.

  - type: table
    name: None
    filters:
      and:
        - summary_progress.isEmpty()
        - random() >= .9
    limit: 10

What am I doing wrong?

You just need to do something with the generated numbers. For example, create a Properties formula with random(), sort on that formula, and limit the number of results to 15.

formulas:
  randomSort: random()
views:
  - type: table
    name: Table
    order:
      - file.name
    sort:
      - property: formula.randomSort
        direction: ASC
    limit: 15

Your random() >= .9 filter was simply leaving to chance how many would get included. Statistically with large samples, you could end up with approximately 10% over time, but that’s not reliable for each, individual refresh.

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