Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
Could you please let me know what is wrong in the below script. When i execute the below script, getting below error message.
Error in expression:
Year takes 1 parameter
[InvExp Calendar]:
LOAD DISTINCT
Temp_Date as ExpiryDate,
MonthStart(Temp_Date) as ExpiryMnthDate,
Year(Temp_Date) as [InvExpYear],
Month(Temp_Date) as [InvExpMonth],
Month(Temp_Date)&'-'&Date(Temp_Date, 'YY') as [InvExpMonthName],
num(Month(DATE(Temp_Date,'DD/MM/YYYY'))) as [InvExpMonthNumber],
Date(Temp_Date, 'YYYY-MM') as [InvExpiryMonth],
((Year(Temp_Date) - Year($(vExpStartDate)))*12) + Num(Month(Temp_Date)) as InvExpRollingMonth;
LOAD DISTINCT
($(vExpStartDate) + IterNo() - 1) as Temp_Date
AUTOGENERATE (1)
WHILE $(vExpStartDate) + IterNo() - 1 <= $(vExpEndDate);
Thank you.
Regards,
Viresh
There you have it. The code won't work if you do not enter acceptable values in variables vExpStartDate and vExpEndDate.
To test it out, you an create these variables in Settings->Variable Overview and supply values for them.
What is the contents of vExpStartDate?
Probably one of your variables that are used in $-sign expansion, in reality expands to ... nothing. You know, this error can mean that you either specify too many or too few parameters for the Year() function.
Check the spelling of your variables, and if they check out fine, check their content.
It is showing as <Null>
There you have it. The code won't work if you do not enter acceptable values in variables vExpStartDate and vExpEndDate.
To test it out, you an create these variables in Settings->Variable Overview and supply values for them.