This content has been marked as final. Show 1 reply
Maybe like this:
SET Bank01 = "'01/01/2016','02/02/2016'"; Set Bank02 = "'01/01/2016'"; MyTable: LOAD * INLINE [ Exclusion Calendar, Payment Date, Customer, Days Bank01, 02/02/2016, Customer123, 1 Bank01, 04/02/2016, Customer234, 1 Bank02, 02/02/2016, Customer458, 1 ]; For Each vBank in 'Bank01','Bank02' RESULT: LOAD *, LastWorkDate([Payment Date], Days, $($(vBank))) as NewPaymentDate; LOAD * RESIDENT MyTable Where [Exclusion Calendar] = '$(vBank)'; Next vBank DROP TABLE MyTable;
You can create some code that retrieves all bank names from your MyTable table to be used in the For Each loop.
Customer Days Exclusion Calendar Payment Date NewPaymentDate Customer123 1 Bank01 02/02/2016 02/03/2016 Customer234 1 Bank01 04/02/2016 04/04/2016 Customer458 1 Bank02 02/02/2016 02/02/2016