Sum miles

I need to sum total trip miles from one table to another. The catch is i need the totals to reflect the driver and purpose (work /personal), example: Driver one = 250miles personal , 1200 miles work, month end total.

I have formulas built into a spreadsheet to do this but cant figure out the right way to approach it in the appsheet. 

I think i should bring individual trip mileage over from one table (vehicle use table) into the other table (vehicles table), depending on use (Work/per). Then total it there. 

Any help would be appreciated! 

 

0 1 78
1 REPLY 1

You never need to transport data just to perform calculations.   The table just need some way to link the rows together - e.g. Driver.

You haven't mentioned what type of data you have in the two tables, so I'm shooting in the dark a little.

Based on your description of personal vs work, here is what I would,  In the table where you are summing up the values have a [Personal Miles] column and a [Work Miles] column and then create SUM() expressions to compute these, e.g.:

[Personal Miles] -> SUM(SELECT(Log Table[Miles], AND([Driver] = [_THISROW].[Driver], [Driving Type]  = "Personal")))

[Work Miles] -> SUM(SELECT(Log Table[Miles], AND([Driver] = [_THISROW].[Driver], [Driving Type]  = "Work")))

 Then if you want to display it like you described, you can create a Driving Display column that uses an expression to put the computed values into a text based description:

[Driving Display] -> [Personal Miles] & " miles personal, " & [Work Miles] & " miles work, month end total"

I hope this helps! 

Top Labels in this Space