Buenas tardes, recibe un cordial saludo. Lo que yo haría sería hacer selects anidados:
select *,( select count(docnum)
from oinv t0 where docdate between ‘20210701’ and ‘20210731’ and facs.CardCode=t0.CardCode)
from (
select cardcode,sum(DocTotal) doctotal
from oinv where docdate between ‘20210701’ and ‘20210731’
group by CardCode) facs
Saludos.
SELECT count(T0.[DocNum]) 'Nº Facturas', T0.[CardName] 'Nombre', sum(T0.[DocTotal]) 'Total' FROM OINV T0 WHERE T0.[DocDate] >='20220301'
group by T0.[CardName]