I need to build a straight table showing SAP/NON SAP submissions and non submissions for all companies.
Tables ledger, purchase and sales both contain sap and non sap data and SAP_Flag as identification for it. Company table holds all company details (There are 6 companies which are purely non sap, 2 companies submit both sap and non sap data and rest others are sap companies. ).
So matrix for this requirement is as below. My issue is how to calculate total number of companies which has done submission and non submission for SAP and NON SAP.