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

Date Difference is giving validation error in SAP Analytic cloud data action

brahmareddy_kolli
Participant
0 Kudos
408

Hi Everyone

I am getting invalid date format error. Created Disposal Date as attribute (Text -Data type) in Asset Dimension.

Date format: YYYYMM in StartDate Attribute in Asset Dimension

Date Dimension: YYYYMM

 
MEMBERSET [d/CALMONTH] =[d/Version].[p/START_DATE] TO [d/Version].[p/END_DATE]
MEMBERSET [d/MEASURE]="DEPRECIATION"
MEMBERSET [d/ASSET].[p/START_DATE] != " "
 
DELETE()
FOREACH [d/CALMONTH]
IF DATEDIFF([d/CALMONTH],[d/ASSET].[p/START_DATE],"MONTH")>=0 THEN
DATA()=RESULTLOOKUP([d/CALMONTH]=PREVIOUS(1,"MONTH",[d/Version].[p/START_DATE]),[d/Version]="public.Actual")
ENDIF
ENDFOR

brahmareddy_kolli_0-1743794004867.png

With Regards,

Brahma Kolli

View Entire Topic
William_Yu1
Product and Topic Expert
Product and Topic Expert
0 Kudos

Not sure if you are showing the right piece of code generated the error, the attribute name from the error message is different from the attribute you used in the script. 

BTW, as far as I can see, the FOREACH loops seems NOT necessry in this case. 

brahmareddy_kolli
Participant
0 Kudos

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

MEMBERSET [d/MEASURE]="DEPRECIATION"

MEMBERSET [d/ASSET].[p/START_DATE] != " "

DELETE()

IF DATEDIFF([d/CALMONTH],[d/ASSET].[p/Dreciation_Start_Period],"MONTH")>=0 THEN

DATA()=RESULTLOOKUP([d/CALMONTH]=PREVIOUS(1,"MONTH",[d/Version].[p/Dreciation_Start_Period]),[d/Version]="public.Actual")

ENDIF

But still i am getting the same error.

brahmareddy_kolli
Participant
0 Kudos
FYI .. I am getting same error