Previous amount of month is double value

Hi,

I have to add column month to add data column, this is my variable :

image

and this is the error I got :

image

How to get rid of the duplicate value?

Note : Prev month is 2022/03 (March 2022) because previous AddMonths is AddMonths(-3)

@Rhys18

you can append the random number after your column name it will make it unique.

I don’t get it, where do I append it? In the data column or which activity? Can you make it details? Thanks

@Rhys18

"your column name"+new Random().Next(1,999).Tostring

image

But my case is a variable DateTime.Now

@Rhys18

have a look on it
->date(DateTime.Now.ToString).ToString("dd/MM/yyyy")

image

it will uniquely identified your column name.

image

It’s invalid since I am using CDate

Hi @Rhys18,

Do you want it to be added even if it is the same here? If so, you can use below, it will create unique for every second.

previous_moth=DateTime.Now.AddMonths(-1).ToString("yyyy/MM hhmmss")

Regards,
MY

No, I want it to be added for every month and year only (June, July, etc)

How come it is double value thou?

I couldn’t understand it.

I understand correctly that the error received here is located from the same column name. You want the same again, but do you want a double value next to it? So that’s why I thought that adding seconds instead of a double value wouldn’t matter.

No I dont need the double value actually… I need something unique because it’s datetime.now

I tested it for you but the clock still comes.

If you are allowed to create a static excel template here, you can create your column-independent data and append it below. Since you don’t add headers, you don’t need columns.

To be honest I don’t know what to do… Maybe anyone can help with this kind of thing?