In the annualloadbook app we sum the columns in expenses for [Gallons] of fuel purchased. The expression below works great for each individual app user. The Solo IFTA report pulls the totals from the default app user and assigned Unit
I need to modify the expression below to be able to SUM the [Gallons] in table expenses Summing units in the same [Fleet], Fleets has its own Table and is Ref in the Truck and App User Tables
SUM(SELECT([Expenses][Gallons], [State] = "ALBERTA"))
So the app would have to SUM [Gallons],[State] = โALBERTAโ from each app userโs [Expenses] in the same Fleet ID
SUM(SELECT([Expenses][Fuel Tax paid], [State] = "ALBERTA")) Same expression for fuel tax paid for each app userโs in the same Fleet ID
Where expression needs to be
App User Fleet Ref column
Solved! Go to Solution.
Though I cannot be 100% certain of your app architecture, I am assuming the following
The IFTA Report has a USER (ref to App User) and [EXPENSES] is a list of refs to the Expenses table that have the row's USER. Also your EXPENSES table has no direct FLEET column but it is indirectly retrievable from the USER.
Then try
SUM(
SELECT(
EXPENSES[GALLONS],
AND(
[USER].[FLEET] = [_THISROW].[USER].[FLEET],
[State] = "ALBERTA"
)
)
)
Though I cannot be 100% certain of your app architecture, I am assuming the following
The IFTA Report has a USER (ref to App User) and [EXPENSES] is a list of refs to the Expenses table that have the row's USER. Also your EXPENSES table has no direct FLEET column but it is indirectly retrievable from the USER.
Then try
SUM(
SELECT(
EXPENSES[GALLONS],
AND(
[USER].[FLEET] = [_THISROW].[USER].[FLEET],
[State] = "ALBERTA"
)
)
)
SUM(SELECT([Expenses][Gallons],
AND([Truck].[Fleet]=[_Thisrow].[Fleet],[State]= "ALBERTA")))
This is working
Thank you I was stuck
User | Count |
---|---|
17 | |
16 | |
4 | |
3 | |
2 |