Q:

Google Sheets - Query - Running Total below dynamic results

Testing Sheet: 

Wondering if there is a witty way to add a Total to the last row +1 of
  a Query result.
See Sheet 'Lookup' for a static example of what I am asking for.
I don't know if there is a way to have a hidden column that calculates
  transposed only under the last row of a query, or if there is a smart
  way to work Query for this answer.

All great answers. Each on very useful in its use case.
Макс Махров gets the answer with using a query statement.
Now I was not keen on having an extra sheet to hold the totals so I added a row at the top which I can simply hide and used this formula:
query({Orders!A:E;A1:E1},"select Col1, Col3, Col4 where Col2 = '"&C3&"' order by Col4",1)

Only problem I have is trying to figure out how to add TEXT to the bottom row, it seems to only want numerical input.  
How do I fix this?  What am I glitching?
Thanks !
Mars

A:

The trick is to make second query and count totals for selected product.
Plan of actions:

add new sheet with query on it, something like this: =QUERY(Orders!A:E,"select B, 0, sum(D) where B like '"&Lookup!C2&"' Group by B",0)
Prepare arrayformula which combines data in Lookup sheet: = ArrayFormula({Importrange(1),Importrange(2)}) Note that number of columns must retain the same.
Edit query so it takes Col1, Col2, Col3... instead of A, B, C...
Make word 'total' visible instead of zero. Set number format: 0;0;total Set it for range B9:B on Lookup sheet
Make Conditional Formatting with formula =and($B4 =0,isnumber($B4)) for range A4:C on Lookup sheet.

That's seems have to complete the task.
Hope it Helps!
Your Example

