I have a folder with files for each sale of an item. The files contain Name, DateOfSale , Quantity, Cost, Notes .
Here is an example file:
Name:: Some Person
Notes:: Owns party business.
TABLE ("$" + Cost + ".00") as "Total Amount"
to give me a table of all the sales showing the cost in one column “Total Amount”
I want to then get the sum of this column to give me the “Total cost” but can’t seem to figure out how to do it. I have searched and searched but can’t find an example where this is done.
There must be a way. Can anyone point me in a direction?
Another way to put this in words would be: how could I read one field from every file and add them all together and display it?
I’ve never actually had a use case for doing this with dataview even though I use it heavily
The post from here in this forum may help
@gregp , that was totally helpful! Thanks.
So I figured this will give me the number I need in my case:
TABLE sum(rows.Cost) as TotalCost
WHERE Cost != null
GROUP BY true
The only thing now is that this is kinda shown in a table in the middle of the page.
Do you perhaps have any idea how I could do the same but show it something like this:
Total sales: $3546
So basically put that total into some text somewhere on my page where I choose?
Just in case anyone is interested, I also figured out from that post how to get a count of the number of sales entries I have that do not have a $0 cost:
TABLE length(rows) as SalesCount
Where Cost !=null
GROUP BY true
Gives something that looks like:
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.