Skip to content

Commit

Permalink
fix retention report dates and days
Browse files Browse the repository at this point in the history
  • Loading branch information
franciscao633 committed Aug 28, 2024
1 parent ef98cea commit ff0c825
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/app/(main)/reports/retention/RetentionTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export function RetentionTable({ days = DAYS }) {
if (totalDays - rowIndex < day) {
return null;
}
const percentage = records[day]?.percentage;
const percentage = records.filter(a => a.day === day)[0]?.percentage;
return (
<div
key={day}
Expand Down
4 changes: 2 additions & 2 deletions src/queries/analytics/reports/getRetention.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ async function clickhouseQuery(
}[]
> {
const { startDate, endDate, timezone = 'UTC' } = filters;
const { getDateSQL, getDateStringSQL, rawQuery } = clickhouse;
const { getDateSQL, rawQuery } = clickhouse;
const unit = 'day';

return rawQuery(
Expand Down Expand Up @@ -152,7 +152,7 @@ async function clickhouseQuery(
group by 1, 2
)
select
${getDateStringSQL('c.cohort_date', unit)} as date,
c.cohort_date as date,
c.day_number as day,
s.visitors as visitors,
c.visitors returnVisitors,
Expand Down

0 comments on commit ff0c825

Please sign in to comment.