Greetings!
I've created a pivot table using SSIS and the output is being displayed via multicast and copied into an Excel spreadsheet.
Now, I've been asked to add a column within the Pivot table and output the last known balance for each account. For example, fi the last record for Jane Doe was from 12/31/2015, then I would want to use 100, and John Smith 300 as "Balance."
Here is sample data:
From this data -
I now need to created something like this in SSIS:
So far, I've created a CTE that gives me the result desired:
------
;With NBB AS(
Select balance, account_number,market,
Row_Number() Over (Partition by Account_Number order by Processing_Date desc) as RowNumber
from dbo.loandata)
Select balance
from NBB
where nbb.account_number= '12345'
and nbb.market = 'Oklahoma'
and nbb.RowNumber = 1
-----
Questions I have:
I'm not sure if the CTE created is necessary or if there is a better way within SSIS to perform the task?
I'd appreciate if some feedback to identify if it is possible to add the additional column showing a defined Row_Number for balance.
Thank you in advance!
Jeannette