How to sum a table column

Hi,

I have a table called Equipment List with fields
Item Id - Key
Category,
Description
Current Location
Costs - VC - Related Cost details

I have a table Costs with fields
Item Id - Key
Purchase Date,
Cost
PO No

so the costs show as an inline view in the Equipment View for each Item

What I want to calculate is the total cost of all items.
I want to sum the Cost Column in the Costs table.
In Excel this would be =SUM(Tbl_Costs[Cost])

I have added a VC in the Equipment List Table
Sum([Costs][Cost]).

I want to show a list of
Item Id
Cost
and show the total costs for all these items

It seems very simple, just get the sum of a column but I canโ€™t figure it out.
Any help much appreciated

1 24 6,322
24 REPLIES 24

Hello-

Try this adding on your Equipment List table.

SUM(SELECT(Costs[Cost],[Item Id] = [_THISROW].[Item Id])

Thanks @June_Corpuz, so how do I view this this VC?

I have added a VC to Costs called [Total costs] with expression [Item Id].[Total Costs] where Total Costs is the expression you sent

then added a View showing this Column but it is blank

This expression sums the related costs but there will always just be one cost per item.
I want to sum all item costs.
Cost could go in the Equipment List table but I want to show it as an inline view so thats why I created a costs table.

What you wanted to do is to have an inline view of the Total Cost on the Costs reference table?

No, I want to sum up the column Costs in the Costs Table and display this, ideally with a list of all the Item Id associated with this total Cost.

Excel

2X_0_024966c53cccf6c7bdd34e3f8d6d710a1a548764.png

I want to show $894

I have added a table to my Excel spreadsheet [Date] =today() and [Total Cost] : Sum(cost Column in Costs table) and added this table in with a view so I can now see total cost in App but would like to see this on same view with a list of all the item Idโ€™s that make up this total cost.

2X_3_3bd4263543e773c225c68a658bfdabfa8d89085e.png

The snapshot is for the detail view of that [Item Id], of which having one Costs Detail. Whiles the excel snapshot is having 3 different Item Id.

Is my understanding is correct?

I want to show this as a view in the App. It is a simple formula in Excel but cannot figure out how to do this in App. Just this one table with a Sum of the Costs column.

After much searching, there doesnโ€™t seem to be an easy solution to this. I found a sample App - VirtualCounter from @Aleksi (Thanks @Aleksi ) which I am going to try.

https://www.appsheet.com/samples/Update-virtual-TOTAL-when-records-are-updated-in-the-same-table?app...

So this is what I have done.

  1. Create a new tab in Excel
    Summary Id - Key
    Date
    Total Owned Equipment Cost - has formula =SUM(Tbl_Costs[Cost])

  2. Brought this table into App and created a Summary View.

  3. Brought Item Description and Category into Costs table using VC

SELECT(Equipment List[Item Description],[Item Id] = [_THISROW].[Item Id])

  1. Created a View of Costs table with
    Item Id, Category, Description, Cost

  2. Created a Dashboard View showing Summary View and View created in step 4

My next task is to create an action and workflow to PDF and email this view but Iโ€™m not sure this is possible. Director would like a monthly report to show this view to compare monthly costs.

You should be able to do that.

Got the Action and workflow to work @Lynn

@Martina
Great!

Hi Martina,

How are you doing? as I am new here in Appsheet, could you please do this in video clip that i could understand.

I have the same problem, but i cannot do that.

thanks

Hi @Post_Consulate, which part are you having a problem with? To get a report I ended up doing a workflow that produced an Excel File and I did a Summary section in the workflow template using SUMIFS formula. I can break costs down and do summaries easily this way.

I have another query on this .

Some Items are classed as High Value in the Equipment List Table. Yes or No.

2X_0_060f05d411ad00ecd34700b34c423172db97c5f3.png

I have brought this column into the costs table similar to the Description and Category above as a VC.
SELECT(Equipment List[High Value],[Item Id] = [_THISROW].[Item Id])

I want to create a slice of the Costs table for all high Value items but I get the error:

2X_9_9b6d214b3cd94fe5e79c743e92ba373799277173.png

Go to Slices, add a new slice then add [High Value]=โ€œYesโ€ on the row filter condition

Hi @June_Corpuz, thatโ€™s what I did and got the error

2X_9_9b6d214b3cd94fe5e79c743e92ba373799277173.png

Anyone have any solutions for this please?

Figured it out

IN(โ€œYesโ€, [High Value])

I have also tried bringing the Item Cost into the Equipment List table as a VC but it is then a list type and not a Price type thinking I could do the slice on the Equipment List instead

2X_e_e98156b3a382789a441636e43d2ea98e2f8ccd7d.png

Any way to display this as ยฃ100.00?

You can use lookup formula change the Type to Price

I created another tab in my Excel spreadsheet to do the SUM and then imported this table into Appsheet and used in a Dashboard view.

thanks a lot, I will try to do it, if i have any problem i will ask you.

thanks again

Top Labels in this Space