update avg aggregate for revenue report

This commit is contained in:
Francis Cao
2024-10-15 09:24:19 -07:00
parent 9d0da45c09
commit 065499a3fa
5 changed files with 17 additions and 23 deletions

View File

@@ -87,7 +87,7 @@ export function RevenueView({ isLoading }: RevenueViewProps) {
const metricData = useMemo(() => {
if (!data) return [];
const { sum, avg, count, unique_count } = data.total;
const { sum, count, unique_count } = data.total;
return [
{
@@ -96,7 +96,7 @@ export function RevenueView({ isLoading }: RevenueViewProps) {
formatValue: n => formatLongCurrency(n, currency),
},
{
value: avg,
value: count ? sum / count : 0,
label: formatMessage(labels.average),
formatValue: n => formatLongCurrency(n, currency),
},