How can i get a SUM of a column from a table ...

How can i get a SUM of a column from a table that contains the reference key to a parent table in a one to many relationship??

In SQL it would be something like:

SELECT SUM([Price]) from tblInvoice WHERE tblCUSTOMER([CustId]) = tblINVOICE([CustId])

0 4 2,635
4 REPLIES 4

@Geoff_Ringent

SUM(SELECT(INVOICE[Price],[CustId]=[_THISROW].[CustId]))

Thanks!

Thanks for that Levent โ€ฆ but i cannot seem to find how to use that expression to get what i want โ€ฆ which is this:

I have a spreadsheet with two tabs (tables) โ€ฆ first tab contains the main record which has DATE as Primary Key โ€ฆ the next tab has child records with that DATE as a Foreign Key (along with its own PK of course).

In my app i have been able to create a slice where it returns the single header row for TODAY() โ€ฆ together with the detailed child records belonging to the second tab!!

But where i am now stumped is being able to SUM the financial number column in the child table for that particular header date โ€ฆ and then being able to show that summation in the header record โ€ฆ as some โ€˜virtual fieldโ€™ i suppose?? โ€ฆ so that the user can always see what the running total for the particular day is.

Can this be done?? If so any tips would be appreciated.

Thankyou in advance.

SUM([RelatedRecords][Price])

Top Labels in this Space