# Hello, So I need to know how to calculate the...

(Steven Jeffery) #1

Hello, So I need to know how to calculate the sum of a number for multiple records associated with a company.

Example: I have a company master record, that has an associated table that holds pieces of equipment.

ABC Company has 5 pieces of equipment.

Each piece of equipment is held in the estimate table which is related to the Company Table. I want to sum the total amount of hours for each individual piece of equipment that is held in the estimate table, which is again related to the master Company table.

When I calculate SUM(estimate[annual tasking time] it gives me ALL the hours associated in the estimate table for every piece of equipment for every record.

It combines all companies together. I want to sum ONLY the time for each record associated with a particular company.

How do I do this?

I assume I have to tell it to only SUM certain records, though I don’t know how to write this. Thanks in advance…

#2

@Steven_Jeffery Try SUM(SELECT…, etc

(Steven Jeffery) #3

So if I wanted to pull total hours from a table for certain company.

sum(select([company],[hours]) ?? I know that is not right, but how would I write it?

(Steven Jeffery) #4

SUM(SELECT(ESTIMATE[Total Annual PM Time], [Company] =

[_THISROW].[Company])) I think I figured it out.

#5

Cool, sorry was on my phone .