Things I have tried
I am trying to create a Dataview table from a Note with payment information.
TABLE pdf, Date, by
What I’m trying to do
I am tying to create a table Note with payment information and then
a query of this information in a table form using Dataview.
** Source File: “Test-Dataview Data”
By: [[Welt and Rehume]]
By: [[JKG Collaborative, LLC]]
** Query File: “Test File - Daview Query”
TABLE pdf, Date, by
I would like this to look like this:
With multiple payments in the same file, this gets a bit harder to do because it is hard to make sure the information for the same payment stays tied together. For example in your sample file, you have an extra instance of “Date” at the top of the page, so if I said "give me the first instance of pdf, Date, By, … " I’d get some wrong information, and the problem would be worse if I asked for “the second instance of each” since it’d be harder to catch the error. I’m writing those commands in words because they are pretty hard to express in dataview even if you had everything perfectly lined up. Is having them all in the same file a requirement for you or could you separate out each payment block of info into a different file? You already have a tag set up, so the FROM in your table could stay the same!
Additionally, watch out for the number of colons
: between your field names and field values. For dataview inline fields (which is definitely the way to go here), you need to have two colons between field name and value. So your
Amount:: lines are correct but most of the other ones are not.
Maybe somebody else will have a creative solution for multiple receipts per file. Otherwise, if you can separate them into different files, I think your table query is on the right track! Good luck!
Once more, thank you for your prompt resposne.
(and excuse the delay in responding - family COVID issues kept me from visiting the forum)
Will try again using your recommendation of individual notes for each transaction.
Now that I had the opportunity to read up some more about Dataview/Obsidian it seems the better way to go abuot it.
PS: If I may another related question:
Is there a way to define sub-variables inline? (Like in YAML)?
I hope everyone is healthy and ok!
Good question! That would be a way to get around the correlation issue. I don’t know, but I’ll look into it and then edit this post. My intuition is that line-breaks are a fundamental problem for inline fields. But, as you point out, this kind of nesting works in YAML, so maybe there is a solution!
@Puy the following both worked for me in that the sub-keys were recognized as keys in their own right and the full value appeared in the value for the outer key:
(variable2:: [key3:: val1], [key4:: val2])
[variable3:: (key5:: val1), (key6:: val2)]
Any line-breaks will cause the outer key to have the wrong value though, even with the parens or brackets for grouping.
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.