Ok I am getting close to how I want this to w...

expressions
(Steven Jeffery) #1

Ok I am getting close to how I want this to work.

I need help tweeking it if possible:

Here is the expression in my template:

CompanyID: <<[CompanyID]>> Company: <<[Company]>> PM Sell: <<[PM Sell]>> Total Annual Hrs. Sold:<<Start: [Related Estimates By Company]>><<[Sum Hours]>><>

Here is how it is coming through on the email:

CompanyID: Portland Greyhound

Company: Portland Greyhound

PM Sell: $10,928.00

Total Annual Hrs. Sold:70

Total Annual Hrs. Sold:70

Total Annual Hrs. Sold:70

Total Annual Hrs. Sold:70

Total Annual Hrs. Sold:70

Total Annual Hrs. Sold:70

Total Annual Hrs. Sold:70

Total Annual Hrs. Sold:70

I ONLY want “Total Annual Hrs. Sold:70” to show up 1x on the report.

The reason it is coming through 8x’s is because I have (8) pieces of equipment in the table, that it is calculating for me.

Is there a way to make it only give me (1) response?

(Steven Jeffery) #2

@Aleksi_Alkio Would I do this through MAX ROW function?

maybe make another virtual column?

(Philip Garrett) #3

@Steven_Jeffery

It looks like you are trying to track “Total Annual Hrs.” by company. If so, I would add a virtual column to the “Company” table that computes the “Total Annual Hrs.”

Having done that, you would eliminate the <> <> and simply replace them with the name of your new virtual column.

That has the added advantage that the “Total Annual Hrs.” can also be displayed when the Company record is displayed by the application.

If your data is stored in a worksheet, you could compute the “Total Annual Hrs.” in a worksheet expression. This might be more efficient if lots of computation is required to compute the total. However, the total would only be updated when you do an update that touches the worksheet.

(Steven Jeffery) #4

But the total annual hrs are housed in the estimate table, which is related to the company table.

So how do you make a virtual column that calculates the total annual hours in the related estimate table?

(Bellave Jayaram) #5

In the company table, if your related col is called “Related Estimates”, you can use SUM([Related Estimates][Hours])

(Philip Garrett) #6

@Bellave_Jayaram

Thanks Jayaram.

I have added this information under topic “Sum” in article https://help.appsheet.com/expressions/expression-types/list-expressions-and-aggregates

Intercom app.intercom.io

(Bellave Jayaram) #7

You are welcome, Phil.

(Steven Jeffery) #8

Thanks guys…