Hi, Just wondering if anyone would be able to help with the SAS PROC SQL codes please? Raw data sample in Table 1 I've to summarise the amount for different Product Types (Table 2) - both at a department level (Table 3) and a section level (Table 4). Both department and section lists are dynamic - they change every month. I've to refer to these dynamic tables for summarisation. A sample of expected end results in (Table 5a and 5b) Would someone know what's the SAS PROC SQL codes to summarise by referring to different dynamic tables please? Thanks. Raw Data sample (Table 1) Department Section Product Type Amount Department A Section D 101 1,000,000 Department C Section B 105 2,000,000 Department B Section E 102 3,000,000 Department E Section B 103 4,000,000 Department D Section A 104 5,000,000 Department B Section C 102 9,000,000 Department C Section D 101 8,000,000 Department A Section B 103 5000,000 Department E Section E 104 7,000,000 Department B Section D 102 1,500,000 Table 2 - a list of products that require summarising at both a department and a section level. Product Type 101 102 103 104 105 Table 3 - a list of latest department names (dynamic, changes each month) Department Name Department A Department B Department C Department D Department E Table 4 - a list of latest section names (dynamic, changes each month) Section Name Section A Section B Section C Section D Section E Table 5a - expected results, summarising by department Department Name Product Type Amount Department A 101 500,000 Department A 102 600,000 Department A 103 700,000 Department A 104 800,000 Department A 105 900,000 Department B 101 120,000 Department B 102 320,000 Department B 103 240,000 Department B 104 630,000 Department B 105 812,000 Table 5b - expected results - summarising by section Section Name Product Type Amount Section A 101 40,000 Section A 102 80,000 Section A 103 30,000 Section A 104 20,000 Section A 105 70,000 Section B 101 90,000 Section B 102 80,000 Section B 103 10,000 Section B 104 58,000 Section B 105 91,000
... View more