Hi Community, I am trying to find a way to solve an issues below mentioned. Raw data: ID Month Cost 1 Jan-07 5 1 Jan-07 5 1 Mar-07 5 1 May-07 5 2 Aug-08 6 2 Aug-08 6 2 Dec-08 13 Logic: The requirement has 2 tasks 1) Get the Minimum and Maximum of Month variable by ID. For Ex: for ID 1 Min is Jan-07 and Max is May-07. 2) Create a sequence of month-year from Minimum to Maximum. For Ex: for ID 1 The output starts at Jan-07 and ends at May-07, Even if raw data doesn't include Feb-07,April-07 the final output needs all the missing months to be added in sequence. 3) Sum the costs by ID and month and If no costs present then assign 0. For Ex: For ID 1 the Jan-07 costs add up to 10 and the output has 10 under the cost variables. and if not costs present to add then 0 is expected under the cells. Output: ID Month Cost 1 Jan-07 10 1 Feb-07 0 1 Mar-07 5 1 Apr-07 0 1 May-07 5 2 Aug-08 12 2 Sep-08 0 2 Oct-08 0 2 Nov-08 0 2 Dec-08 13 I am trying to solve this in Proc Sql but unable to get it work. Any suggestions. Thank you for your time.
... View more