gp1981 / SEC_data_analysis

This repository contains R scripts for retrieving and analyzing company data from the U.S. Securities and Exchange Commission (SEC) filings.
https://gp1981.github.io/SEC_data_analysis/
MIT License
0 stars 1 forks source link

Calculate missing value in df_std_BS #9

Closed gp1981 closed 3 months ago

gp1981 commented 6 months ago

For the same "fy", "fp", we need to add to df_std_BS the following rows before the pivot_wider:

 new row: if Total Current Assets does not exist then it creates a new row whose val is Total Assets - Total Long Term Assets and standardized_balancesheet_label is Total Current Assets

new row: if Other Current Assets does not exist then it creates a new row whose val is Total Current Assets - (Cash and Cash Equivalent + Marketable Securities, Current + Total Accounts Receivable + Total Inventory) and standardized_balancesheet_label is Other Current Assets

new row: if Total Long Term Assets does not exist then it creates a new row whose val is val of Total Assets - val of Total Current Assets and standardized_balancesheet_label is Total Long Term Assets

new row: if Other Non Current Assets does not exist then it creates a new row whose val is val of Total Long Term Assets - val of (Marketable Securities, Non Current + Property, Plant and Equipment+ Intangible Assets (excl. goodwill) + Goodwill) and standardized_balancesheet_label is Other Non Current Assets

new row: if Total Current Liabilities does not exist then it creates a new row whose val is val of Liabilities - val of Liabilities, Non Current and standardized_balancesheet_label is Total Current Liabilities

new row: if Other Current Liabilities does not exist then it creates a new row whose val is val of Total Current Liabilities - val of (Accounts Payable, Current + Taxes Payable, Current + Commercial Paper + Long Term Debt, Current Maturities + Operating

new row: if Total Long Term Liabilities does not exist then it creates a new row whose val is val of Total Liabilities - val of Total Current Liabilities and standardized_balancesheet_label is Total Long Term Liabilities

new row: if Other Long Term Liabilities does not exist then it creates a new row whose val is val of Total Long Term Liabilities - val of (Long Term Debts - Operating Lease, Liability, Non Current + Finance Lease, Liability, Non Current and standardized_balancesheet_label is Other Long Term Liabilities

new row: if Other Stockholders Equity does not exist then it creates a new row whose val is val of Total Company Stockholders Equity - val of (Common Stock + Additional Paid in Capital + Preferred Stock + Retained Earnings + Accumulated other comprehensive income (loss)) and standardized_balancesheet_label is Other Stockholders Equity