Skip to content

Commit

Permalink
update getDomain with console logs
Browse files Browse the repository at this point in the history
  • Loading branch information
SFJohnson24 committed Jun 24, 2024
1 parent d33ee11 commit 77e0419
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/utils/ExcelDataset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,18 @@ const getRecords = (cols: IVariable[], rows: {}[]): {} => {
};

const getDomainName = (rows: {}[], sheetName: string): string => {
return rows.length > 3 && rows[3]["DOMAIN"]
? rows[3]["DOMAIN"]
: /* This is technically not the domain name,
but it is what the CORE engine currently expects */
sheetName.toUpperCase().replace(".XPT", "");
console.log(`Sheet Name: ${sheetName}`);
console.log(`Number of Rows: ${rows.length}`);
console.log(`Rows: `, rows);
if (rows.length > 3) {
const domainRow = rows[3];
console.log(`Row 4 (Domain Row):`, domainRow);
const domainName = domainRow["DOMAIN"] || domainRow["RDOMAIN"];
console.log(`Domain Name Extracted: ${domainName}`);
return domainName || sheetName.toUpperCase().replace(".XPT", "");
}
console.log(`Using Sheet Name as Domain: ${sheetName.toUpperCase().replace(".XPT", "")}`);
return sheetName.toUpperCase().replace(".XPT", "");
};

const mergeDatasetRecords = (
Expand Down

0 comments on commit 77e0419

Please sign in to comment.