jamuna_T
(jamuna T)
October 13, 2024, 10:10am
1
Hi,
I have a input value with date.
Processing the value with loop of column by column. When i process A column date, in the same loop i have to take next B column Date & Subtract one day from B column date.
when i process B column , need to take date from C column & Subtract one day from C column date. Likewise loop will be continue. How to do this
Can someone assist me on this please?
sudster
(Sudster)
October 13, 2024, 10:34am
2
Hi @jamuna_T ,
Could you please post your input data table with 5 rows of sample data and an expected output table for the input data?
From what it seems, you need to loop over the rows, and then loop over each column of each row.
Hi @sudster ,
Use Excel Application Scope to read the data into a DataTable .
Use a For Each Row activity to loop through each row of the table.
Inside the loop, use Assign activities to subtract one day from the next column’s date.Example logic:
If processing Startdate1:
expectedDate = DateTime.Parse(row("Startdate2").ToString()).AddDays(-1).ToString("M/d/yyyy")
If processing Startdate2:
expectedDate = DateTime.Parse(row("Startdate3").ToString()).AddDays(-1).ToString("M/d/yyyy")
Continue this pattern for the remaining columns.
This way, the loop processes each column, and in each iteration, it subtracts one day from the next column’s date.
1 Like
sudster
(Sudster)
October 13, 2024, 10:59am
5
@jamuna_T , I made this workflow based on your initial post; not too sure it this what you require.
Or may be this?
1 Like
@jamuna_T ,
Why not start column iteration from Column B instead of Column A?
If to start iteration from Column B then you will have to just subtract a day and use that date.
1 Like
Hi @jamuna_T
Please find attached workflow to get next column date value while processing previous which will subtract day 1 from each column
Let me know if it’s working
DateSubstract.zip (48.6 KB)
1 Like
jamuna_T
(jamuna T)
October 13, 2024, 6:05pm
8
Its perfectly taking the next colum value with subtraction of one day.
Thanks a lot!!
system
(system)
Closed
October 16, 2024, 6:08pm
10
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.