please have a look at attached sample.
There are various methods to achieve what you want, it depends what you want to do with the total, where you want to display and if your total needs to be sensitive to user selections.
In the script, you could sum and count like
sum(LineTotal) as SumTotal, count([Document Number]) as CountTotal
Resident INPUT where Status='Open' and [Record Source] = 'SALES ORDER';
This total will not be sensitive to user selections in the front end.
In a chart object, you could use calculated dimensions like:
=if([Record Source]= 'SALES ORDER',[Record Source])
and then use a plain sum(LineTotal) and count([Document Number]) as your two expressions (see attached, third table in the middle).
Or you could use [Record Source] and [Status] as dimensions, and use a limitation in your expressions, either using an if() statement (second table) or set analysis (first table). These expressions could also stand alone, without the dimensions, as shown in the text objects.
Hope this helps,
SumCount.qvw 161.0 K