Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some pages can not get render results, please help #36

Closed
webrunneronSun opened this issue Nov 26, 2022 · 6 comments
Closed

some pages can not get render results, please help #36

webrunneronSun opened this issue Nov 26, 2022 · 6 comments

Comments

@webrunneronSun
Copy link

hi,

This is a nice examplt vault! learnt a lot from it. but there are some pages can not get expected reasults, please help.
they are:

  1. Show a meta data vaalue for every day of the week
  2. Show all photos of the week in a grid
    currently i only across these two.

thanks

webrunnerinspace

@claremacrae
Copy link
Contributor

Hi @webrunneronSun, could you help people here to help you, by providing more information.

If you tell us the full file names of the examples including path it will save spending time hunting.

Also, especially in the first one ‘does not give expected results’ is not any information for anyone to help.

What actually happened? Can you show your actual code? Can you show screenshots? What metadata values where you expecting to be shown? Can you show us the files that have metadata in, if that relates to the script?

A general recommendation:
The more you can help out volunteers when asking for help, the greater the chance that you will get the information you want.

@webrunneronSun
Copy link
Author

thanks claremacrae,

i am an obsidian new user knowing a little about it, and keen on learning dataview plugin, I found the dataview_example_vault from https://github.com/s-blu/obsidian_dataview_example_vault and downloaded it to my windows pc.

I opened the vault by obsidian and most of the example markdown pages in that vault works well, i learnt a lot from it.

but I found in the vault folder "20 Dataview Queries", 2 pages:

  1. show a meta data value from every day of the week.md, and
  2. show all photos of the week in a grid.md

for the first page, I can read the dataview code in editor mode, but I got "Dataview: No results to show for this list query " for all the dataview blocks. I pretty sure the page is going to show some thing with these dataview codes, I got nothing, why this happen?

for the second page, I even can not get any hint for the dataview blocks on this pages . when I switch to preview mode, those dataview cods just disappeared. required css snippet had been actived already. I wonder why.

looking for your helps. thanks a lot.

B/R

webrunneronSun

@webrunneronSun
Copy link
Author

first page, show a mete data vaule from every day of the week.md:

description: Show a certain value for every day of the week, i.e. a summary of the day, or what nice happened the day
topics:

  • weekly aggregation
  • custom output
  • date based overviews
    fake:
    name: "2022-W4"
    name2: "2022-W5"
    #dv/list #dv/from #dv/where #dv/sort #dv/string #dv/split #dv/dateformat #dv/link #dv/join #dv/table #dv/array #dv/choice #dv/typeof

Show a meta data value for every day of the week
Basic
Usage in weekly note
If you want to use this query in your weekly note and your weekly is named like gggg-[W]ww, i.e. 2022-W4, replace fake.name with file.name

Dataview: No results to show for list query.

Alternative usage
Instead of a summary of the day you could note down something nice that happened that day and remind yourself that the week was quite nice in retrospective!

Variants
Print weekdays instead of file names
Dataview: No results to show for list query.

Print weekdays instead of file names but still link to daily
Dataview: No results to show for list query.

Print multiple values per day
Dataview: No results to show for list query.

Print multiple values per day as table
Day0 note
Dataview: No results to show for table query.

Print multiple values per day as table in unified look
Day0 Notes
Dataview: No results to show for table query.

Similar Queries


below is the source code


description: Show a certain value for every day of the week, i.e. a summary of the day, or what nice happened the day
topics:

  • weekly aggregation
  • custom output
  • date based overviews
    fake:
    name: "2022-W4"
    name2: "2022-W5"

#dv/list #dv/from #dv/where #dv/sort #dv/string #dv/split #dv/dateformat #dv/link #dv/join #dv/table #dv/array #dv/choice #dv/typeof

Show a meta data value for every day of the week

Basic

[!attention] Usage in weekly note
If you want to use this query in your weekly note and your weekly is named like gggg-[W]ww, i.e. 2022-W4, replace fake.name with file.name

LIST summary
FROM "10 Example Data/dailys"
WHERE string(day.year) = split(this.fake.name, "-W")[0] AND string(day.weekyear) = split(this.fake.name, "-W")[1]
SORT file.name

[!hint] Alternative usage
Instead of a summary of the day you could note down something nice that happened that day and remind yourself that the week was quite nice in retrospective!

Variants

Print weekdays instead of file names

LIST WITHOUT ID "**" + dateformat(day, "cccc") + "**: " + summary
FROM "10 Example Data/dailys"
WHERE string(day.year) = split(this.fake.name, "-W")[0] AND string(day.weekyear) = split(this.fake.name, "-W")[1]
SORT file.name

Print weekdays instead of file names but still link to daily

LIST WITHOUT ID "**" + link(file.path,  dateformat(day, "cccc")) + "**: " + summary
FROM "10 Example Data/dailys"
WHERE string(day.year) = split(this.fake.name, "-W")[0] AND string(day.weekyear) = split(this.fake.name, "-W")[1]
SORT file.name

Print multiple values per day

LIST WITHOUT ID "**" + dateformat(day, "cccc") + "**: " + join(note, " | ")
FROM "10 Example Data/dailys"
WHERE string(day.year) = split(this.fake.name2, "-W")[0] AND string(day.weekyear) = split(this.fake.name2, "-W")[1]
SORT file.name

Print multiple values per day as table

TABLE WITHOUT ID "**" + dateformat(day, "cccc") + "**" AS "Day" , note
FROM "10 Example Data/dailys"
WHERE string(day.year) = split(this.fake.name2, "-W")[0] AND string(day.weekyear) = split(this.fake.name2, "-W")[1]
SORT file.name

Print multiple values per day as table in unified look

TABLE WITHOUT ID "**" + dateformat(day, "cccc") + "**" AS "Day" , choice(typeof(note) = "array", note, array(note)) AS "Notes"
FROM "10 Example Data/dailys"
WHERE string(day.year) = split(this.fake.name2, "-W")[0] AND string(day.weekyear) = split(this.fake.name2, "-W")[1]
SORT file.name

%% === end of query page === %%

[!help]- Similar Queries
Maybe these queries are of interest for you, too:

LIST
FROM "20 Dataview Queries"
FLATTEN topics as flattenedTopics
WHERE contains(this.topics, flattenedTopics)
AND file.name != this.file.name
dv.view('00 Meta/dataview_views/usedInAUseCase',  { current: dv.current() })

@webrunneronSun
Copy link
Author

I noticed that these dataview code shoud be put in a weekly notes with page name 2022-W4, I did that, and I replaced the "fake" with "file" as metioned in the page, but, still nothing happens to my page 2022-W4

@s-blu
Copy link
Owner

s-blu commented Nov 28, 2022

Hello @webrunneronSun, thank you alot for this very detailed report! Of course, all the queries inside the example vault should give you results. I fixed the two you found - I changed the example data due to a duplicated key and seems to have broken them while doing so.
You need to use file.day instead of only day, then it should work. Have a look here to find the fixed queries:

https://s-blu.github.io/obsidian_dataview_example_vault/20%20Dataview%20Queries/Show%20all%20photos%20of%20the%20week%20in%20a%20grid/
https://s-blu.github.io/obsidian_dataview_example_vault/20%20Dataview%20Queries/Show%20a%20meta%20data%20value%20for%20every%20day%20of%20the%20week/

closed via b4577bb. Thanks again for reporting!

@s-blu s-blu closed this as completed Nov 28, 2022
@webrunneronSun
Copy link
Author

many thanks! s-blu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants