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

Data action copy with date condition

brahmareddy_kolli
Participant
0 Kudos
1,431

Hi ,

The version dimension has two attributes Start_date (202308) and End_Date (202412) and the asset dimension has a disposal month attribute (202410). The disposal month will vary from asset to asset and a few assets might be greater than the end date.

if the disposal month is less than the end date, then tractional data should copy from the previous month to the disposal month only.

if the disposal month is greater than the end date, then transaction data should copy from previous months to the end date.

With Regards,

KBR.

View Entire Topic
N1kh1l
Active Contributor
0 Kudos

kollibrahma

Thanks for putting up the example. The below code should do the job. I have created the example using Product dimension but you can replace it with your Asset dimension

Version Dimension

Asset Dimension

MEMBERSET [d/CALMONTH] =[d/Version].[p/START_DATE] TO [d/Version].[p/END_DATE]
MEMBERSET [d/MEASURE]="DEPRECIATION"


DELETE()
FOREACH [d/CALMONTH]
	
	IF DATEDIFF([d/CALMONTH],[d/SAP_CEP_PRODUCT].[p/DISPOSAL_DATE],"MONTH")>=0 THEN
		DATA()=RESULTLOOKUP([d/CALMONTH]=PREVIOUS(1,"MONTH",[d/Version].[p/START_DATE]),[d/Version]="public.Actual")
	ENDIF
ENDFOR

Initial Data:

After Depreciation Copy

Asset1 with disposal date 202410, data was copied only till 202410

Asset2 with disposal date 202504, data was copied only till 202412 (202504 > 202412 (version end date)

Hope this helps !!

Please accept/upvote if this helps

Nikhil