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
For the same "fy", "fp", we need to add to df_std_BS the following rows before the pivot_wider:
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