cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

copy data based on the current week of current year to next year in SAC planning

saikhancs35
Explorer
0 Kudos
155

Hello,

I want to write a data action which copy the data into next year based on the current week. Below is an example assuming my current week is 202503:

Retail WeekVersionAmount
202601LY2000
 CY3000
 NY2000
202602LY4000
 CY5000
 NY4000
202603LY6000
 CY7000
 NY7000
202604LY8000
 CY9000
 NY9000
202605LY10000
 CY11000
 NY11000

 

Assuming my current week is 202503, so my requirement is to copy the data from Version LY to NY till 202602 and from Version CY to NY from 202603 onwards.

 

I tried to write below code in SAC data action, but it didn't copy anything in next year, because the range in the scope is not correct. 

Do we have any function which gives me date for next year of current week?

 

MEMBERSET [d/Date] = "2026-01-01" TO PERIOD(TODAY())
DELETE()
DATA()= RESULTLOOKUP([d/Version]="public.LY").
 
Is there anyway to achieve this?
 
Thanks.

Accepted Solutions (0)

Answers (1)

Answers (1)

N1kh1l
Active Contributor
0 Kudos

@saikhancs35 

You example is not clear enough to advise you a code.

2026-01-01" TO PERIOD(TODAY()) , If we are in 2025 the start date range is higher then the end range. May be you should explain clearly what you want to copy and where you want to copy to.

Nikhil

 

saikhancs35
Explorer
0 Kudos

@N1kh1l:

My requirement is to copy the data of 2026 from one version to another version based on the current week of 2025.

For example in my above screenshot, i am assuming that my current week is 202503, so i want to copy the data of 202601, 202602 from the version LY to NY but for the week 202603, 202604, 202605 and so on i want to copy data from version CY to NY.

The code which i provided is not working because my date range is not correct. Initially i put below code:

MEMBERSET [d/Date] = "2025-01-01" TO PERIOD(TODAY())
DELETE()
DATA()= RESULTLOOKUP([d/Version]="public.LY").

So this was working fine for the data of year 2025. But i want same flexibility for the data of year 2026.

I hope i am clear this time.

Thanks,

Saif