alphanome-ai / sec-ai

A comprehensive open-source toolkit for AI-powered analysis and interpretation of SEC EDGAR filings, providing valuable insights for investors, fintech developers, and researchers.
https://sec.alphanome.app
MIT License
112 stars 24 forks source link

Standardize table output: Assign the scale ("millions", etc.) #49

Closed Elijas closed 11 months ago

Elijas commented 1 year ago

Context

Table as it appears originally in the report ``` 1 2 3 4 5 0 Three Months Ended Three Months Ended Nine Months Ended Nine Months Ended 1 July 1, 2023 June 25, 2022 July 1, 2023 June 25, 2022 2 Net sales: 3 Products $60584 $63355 $230901 $245241 4 Services 21213 19604 62886 58941 5 Total net sales 81797 82959 293787 304182 6 Cost of sales: 7 Products 39136 41485 146696 155084 8 Services 6248 5589 18370 16411 9 Total cost of sales 45384 47074 165066 171495 10 Gross margin 36413 35885 128721 132687 11 Operating expenses: 12 Research and development 7442 6797 22608 19490 13 Selling, general and administrative 5973 6012 18781 18654 14 Total operating expenses 13415 12809 41389 38144 15 Operating income 22998 23076 87332 94543 16 Other income/(expense), net (265) (10) (594) (97) 17 Income before provision for income taxes 22733 23066 86738 94446 18 Provision for income taxes 2852 3624 12699 15364 19 Net income $19881 $19442 $74039 $79082 20 Earnings per share: 21 Basic $1.27 $1.20 $4.69 $4.86 22 Diluted $1.26 $1.20 $4.67 $4.82 23 Shares used in computing earnings per share: 24 Basic 15697614 16162945 15792497 16277824 25 Diluted 15775021 16262203 15859263 16394937 ```
Semi-standardized table ``` Key Value Period 0 Net sales: 1 Products $60584 Three Months Ended (July 1, 2023) 2 Services 21213 Three Months Ended (July 1, 2023) 3 Total net sales 81797 Three Months Ended (July 1, 2023) 4 Cost of sales: 5 Products 39136 Three Months Ended (July 1, 2023) 6 Services 6248 Three Months Ended (July 1, 2023) 7 Total cost of sales 45384 Three Months Ended (July 1, 2023) 8 Gross margin 36413 Three Months Ended (July 1, 2023) 9 Operating expenses: 10 Research and development 7442 Three Months Ended (July 1, 2023) 11 Selling, general and administrative 5973 Three Months Ended (July 1, 2023) 12 Total operating expenses 13415 Three Months Ended (July 1, 2023) 13 Operating income 22998 Three Months Ended (July 1, 2023) 14 Other income/(expense), net (265) Three Months Ended (July 1, 2023) 15 Income before provision for income taxes 22733 Three Months Ended (July 1, 2023) 16 Provision for income taxes 2852 Three Months Ended (July 1, 2023) 17 Net income $19881 Three Months Ended (July 1, 2023) 18 Earnings per share: 19 Basic $1.27 Three Months Ended (July 1, 2023) 20 Diluted $1.26 Three Months Ended (July 1, 2023) 21 Shares used in computing earnings per share: 22 Basic 15697614 Three Months Ended (July 1, 2023) 23 Diluted 15775021 Three Months Ended (July 1, 2023) 24 Net sales: 25 Products $63355 Three Months Ended (June 25, 2022) 26 Services 19604 Three Months Ended (June 25, 2022) 27 Total net sales 82959 Three Months Ended (June 25, 2022) 28 Cost of sales: 29 Products 41485 Three Months Ended (June 25, 2022) 30 Services 5589 Three Months Ended (June 25, 2022) 31 Total cost of sales 47074 Three Months Ended (June 25, 2022) 32 Gross margin 35885 Three Months Ended (June 25, 2022) 33 Operating expenses: 34 Research and development 6797 Three Months Ended (June 25, 2022) 35 Selling, general and administrative 6012 Three Months Ended (June 25, 2022) 36 Total operating expenses 12809 Three Months Ended (June 25, 2022) 37 Operating income 23076 Three Months Ended (June 25, 2022) 38 Other income/(expense), net (10) Three Months Ended (June 25, 2022) 39 Income before provision for income taxes 23066 Three Months Ended (June 25, 2022) 40 Provision for income taxes 3624 Three Months Ended (June 25, 2022) 41 Net income $19442 Three Months Ended (June 25, 2022) 42 Earnings per share: 43 Basic $1.20 Three Months Ended (June 25, 2022) 44 Diluted $1.20 Three Months Ended (June 25, 2022) 45 Shares used in computing earnings per share: 46 Basic 16162945 Three Months Ended (June 25, 2022) 47 Diluted 16262203 Three Months Ended (June 25, 2022) 48 Net sales: 49 Products $230901 Nine Months Ended (July 1, 2023) 50 Services 62886 Nine Months Ended (July 1, 2023) 51 Total net sales 293787 Nine Months Ended (July 1, 2023) 52 Cost of sales: 53 Products 146696 Nine Months Ended (July 1, 2023) 54 Services 18370 Nine Months Ended (July 1, 2023) 55 Total cost of sales 165066 Nine Months Ended (July 1, 2023) 56 Gross margin 128721 Nine Months Ended (July 1, 2023) 57 Operating expenses: 58 Research and development 22608 Nine Months Ended (July 1, 2023) 59 Selling, general and administrative 18781 Nine Months Ended (July 1, 2023) 60 Total operating expenses 41389 Nine Months Ended (July 1, 2023) 61 Operating income 87332 Nine Months Ended (July 1, 2023) 62 Other income/(expense), net (594) Nine Months Ended (July 1, 2023) 63 Income before provision for income taxes 86738 Nine Months Ended (July 1, 2023) 64 Provision for income taxes 12699 Nine Months Ended (July 1, 2023) 65 Net income $74039 Nine Months Ended (July 1, 2023) 66 Earnings per share: 67 Basic $4.69 Nine Months Ended (July 1, 2023) 68 Diluted $4.67 Nine Months Ended (July 1, 2023) 69 Shares used in computing earnings per share: 70 Basic 15792497 Nine Months Ended (July 1, 2023) 71 Diluted 15859263 Nine Months Ended (July 1, 2023) 72 Net sales: 73 Products $245241 Nine Months Ended (June 25, 2022) 74 Services 58941 Nine Months Ended (June 25, 2022) 75 Total net sales 304182 Nine Months Ended (June 25, 2022) 76 Cost of sales: 77 Products 155084 Nine Months Ended (June 25, 2022) 78 Services 16411 Nine Months Ended (June 25, 2022) 79 Total cost of sales 171495 Nine Months Ended (June 25, 2022) 80 Gross margin 132687 Nine Months Ended (June 25, 2022) 81 Operating expenses: 82 Research and development 19490 Nine Months Ended (June 25, 2022) 83 Selling, general and administrative 18654 Nine Months Ended (June 25, 2022) 84 Total operating expenses 38144 Nine Months Ended (June 25, 2022) 85 Operating income 94543 Nine Months Ended (June 25, 2022) 86 Other income/(expense), net (97) Nine Months Ended (June 25, 2022) 87 Income before provision for income taxes 94446 Nine Months Ended (June 25, 2022) 88 Provision for income taxes 15364 Nine Months Ended (June 25, 2022) 89 Net income $79082 Nine Months Ended (June 25, 2022) 90 Earnings per share: 91 Basic $4.86 Nine Months Ended (June 25, 2022) 92 Diluted $4.82 Nine Months Ended (June 25, 2022) 93 Shares used in computing earnings per share: 94 Basic 16277824 Nine Months Ended (June 25, 2022) 95 Diluted 16394937 Nine Months Ended (June 25, 2022) ```

Source: Table from recent AAPL 10-Q filing

Task

We'd like to have a separate column in the standardized table. It would contain each value's scale (millions, etc).

The alternative could be just to multiply each number by the scale, but then we risk losing ease of visibility of which values were applied the scale and which were not.

[!NOTE] This task is tentative, feel free to start a discussion to propose a better alternative. You can do it in the comments below or in the #sec-parser-tables channel.

Currently working on it