Automate issuer overlay creation from ticker searches
This commit is contained in:
@@ -101,7 +101,7 @@ export function buildDimensionBreakdown(
|
||||
return map.size > 0 ? Object.fromEntries(map.entries()) : null;
|
||||
}
|
||||
|
||||
export function cloneStandardizedRows(rows: StandardizedFinancialRow[]) {
|
||||
function cloneStandardizedRows(rows: StandardizedFinancialRow[]) {
|
||||
return rows.map((row) => ({
|
||||
...row,
|
||||
values: { ...row.values },
|
||||
@@ -116,7 +116,7 @@ export function buildLtmStandardizedRows(
|
||||
quarterlyRows: StandardizedFinancialRow[],
|
||||
quarterlyPeriods: FinancialStatementPeriod[],
|
||||
ltmPeriods: FinancialStatementPeriod[],
|
||||
statement: Extract<FinancialStatementKind, 'income' | 'balance' | 'cash_flow'>
|
||||
statement: Extract<FinancialStatementKind, 'income' | 'balance' | 'cash_flow' | 'equity' | 'disclosure'>
|
||||
) {
|
||||
const sortedQuarterlyPeriods = [...quarterlyPeriods].sort((left, right) => {
|
||||
return Date.parse(left.periodEnd ?? left.filingDate) - Date.parse(right.periodEnd ?? right.filingDate);
|
||||
@@ -141,7 +141,7 @@ export function buildLtmStandardizedRows(
|
||||
|
||||
const slice = sortedQuarterlyPeriods.slice(anchorIndex - 3, anchorIndex + 1);
|
||||
const sourceValues = slice.map((period) => source.values[period.id] ?? null);
|
||||
row.values[ltmPeriod.id] = statement === 'balance'
|
||||
row.values[ltmPeriod.id] = statement === 'balance' || statement === 'equity'
|
||||
? sourceValues[sourceValues.length - 1] ?? null
|
||||
: sumValues(sourceValues);
|
||||
row.resolvedSourceRowKeys[ltmPeriod.id] = source.formulaKey ? null : source.resolvedSourceRowKeys[slice[slice.length - 1]?.id ?? ''] ?? null;
|
||||
|
||||
Reference in New Issue
Block a user