Help with DataView Table from Note Information using inline variables

Things I have tried

I am trying to create a Dataview table from a Note with payment information.

TABLE pdf, Date, by
FROM #Receipts 


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”


Date: 220626

tags: #Receipts


Payment:
pdf: [20220425134044.pdf](file:///Z:%5CP1100-QsyncData%5CQsync-DataScanSanp%5CScanSnap%5C02-TG-Documents%5CTG-Checks%20Received%5C2022-Checks%20Received%5C20220425134044.pdf)
By: [[Welt and Rehume]]
Date:: 4/19/22
Amount:: 3675.00
JobNo: 2k21007
DepositDate:

Payment:
pdf: [20220427164727.pdf](file:///Z:%5CP1100-QsyncData%5CQsync-DataScanSanp%5CScanSnap%5C02-TG-Documents%5CTG-Checks%20Received%5C2022-Checks%20Received%5C20220427164727.pdf)
By: [[JKG Collaborative, LLC]]
Date:: 4/21/22
Amount:: 3000.00
JobNo: 2k21050
DepositDate:

** Query File: “Test File - Daview Query”


Date: 06/26/2022

Subject: Test


TABLE pdf, Date, by
FROM #Receipts 


I would like this to look like this:

image

Any ideas?

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!

ScholarInTraining:

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)?

Variable::
-Sub-1::
-Sub-2::
-Sub-3::

etc…

Thanks.

1 Like

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!

EDIT:
@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.

1 Like

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