Create an incremental datetime for each repeated cycle that elapses

Hello, I have a table in excel, to which for each row I must add values, I need the date I have as STRING -> converted to DateTime, each cycle per row increases one month, until the condition is met,

I am confused, since I have a variable called Count, of the type INT which does increase for each Row Cycle, but the DateTime only increases the first cycle and those that follow keep repeating.

Hi @jonn29.jp

Are you incrementing your date by datevariable.AddDays(1) ??

Hope this helps to solve your issue
Mark as solution and like it :innocent:

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer:

no, i’m using AddMonths (1) .ToshortDateString
image
I do not know what type of function to use, since I need to increase the MONTH, for each cycle, increase 1 month, and the next cycle another month,

I just tried what you told me to use AddDays, instead of AddMonth and it didn’t work either, it just keeps incrementing the first cycle but those that follow give me the result of the first one, and not incrementally per month, I need each Cycle loop increase 1 month consecutively
image

image

Hi @jonn29.jp

Can you try this.I hope this can be helpful.

Thanks
Latika
DateMonthIncrement.xaml (5.0 KB)

Hi @jonn29.jp

I have got the output which you are searching and attached the same
Main.xaml (9.0 KB)

Below is the output
image

I have used Todays Date instead of that you can give any date.
Remaining Workflow remains the same

Hope this workflow may help you to solve your query
Mark as solution if this helps you and like it :innocent:

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer:

1 Like

Thank you, Lakita, but what you sent me is the same thing that I put, if inside that Workflow, you put a LOOP or a While, you will realize that it repeats the same date again.

Now I have a question, Pratik, in the workflow you sent me, the date is incremental only if it is a DateTime.now variable, but I need the date to be the one I assigned it, so in my process I was converting a date from STRING DATETIME, since I need it to take the date from the data I give it, not the current date.

Hi @jonn29.jp

I have updated the workflow as requested by you.
Below is the updated workflow which accepts the date string from user.
Main2.xaml (9.4 KB)

As per requirement :-
image

Output :-
image

Mark as solution and like it :innocent:

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer:

1 Like

Thank you very much Pratik, I am telling you to do the action but I do not know how to apply it to the function I need, and I think I formulated my question wrong, I am going again. I have an excel file is a financial amortization table, in which for each row I must increase Date, and month (in whole number), and then calculate the cells by the interest, in this way as shown in the following Excel

Currently I already made an initial part of the process to calculate the databla as a human does, but I want the process that is long and handy to be automatic, so I need the date (STRING), which is as input in the document, when converting it From STRING to DATE TIME, for each Cycle of the ForEach Row increase 1 month, and in the next column increase integer <- (this part of the integer is simple with an INT +1 variable), but I can’t do that when the ForEach Row makes me the next row of the date in an incremental way, it keeps coming out like this:

Hi @jonn29.jp

See look at the below Workflow & SS. I am getting the output what you want for those many counts.
image

I did this without using For Each Row Activity. Below is the Workflow for the same.
Main3.xaml (12.7 KB)
IncreamentMonthAsPerSerialNo.xlsx (8.8 KB)

Hope this workflow may help you to solve your query
Mark as solution if this helps you and like it :innocent:

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer:

1 Like

Hello, Pratik indeed both you and Latika, they were correct, I only had to use CDate (VariableSTRING) to convert it, the problem that the same date repeated to me was caused by the fact that the input variable had to be out of the LOOP sequence , LOL HAHAHAHA, get the variables with the input value and put it before the LOOP and problem solved, now the problem I have is the following, it is more than all visualization and aesthetics, when I convert with CDate (VARIABLESTRING), at it seems the order in which it takes the input is (“MM / dd / yyyy), I am using Convert.ToDateTime (” VARIABLENAME “, new System.Globalization.CultureInfo (” en-PA “)). ToString (” dd / MM / yyyy ") since I live in Panama, and here the date is, day, month and then year, but when I add the function ADD.MONTH (1), and the data is printed in Excel, it puts me first the month and then the year, I am seeing how I solve that little dilemma of visualization but first of all thank you very much for your ap hey, both of them have taken me out of a fight of almost 5 days x’D HAHAHAH


image
a query, without a doubt or if I need additional help, can I add it to this same post? Or should I open a new one?

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.