Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello ,
I have income that I want to spread over the duration of a contract I have the start date and the end date of the contract and I want to generate the different months between the two dates
for example the strat date = 06/21/2022 and the End date: 03/12/2025:
the dates generated will be: 06/21/2022, 07/21/2022,
so on until 03/10/2025, 03/11/2025 and 03/12/2025
and the income will be distributed in a linear fashion over the different dates
here is the script I developed for that but it generates a syntax error can you help me :
fact_rewards_tmp3:
Load Distinct
[Product - Name], ICAO, [AC Type],Conf,MSN,[Customer profile], Partner ,Contract_Start_Date_real,Contract_End_Date,Value_by_partner,[Value Generation (k$/Tail/Yr)], [Platform Fee],
[End Date], [Start Date] ,[Campaign Status],pricing ,dal_revenus,air_revenus1 ,ge_revenus
,Date(addmonths([Start Date], 1)) as ReferenceDate
Resident fact_rewards_tmp2
While (addmonths([Start Date], 1)) <= date(max([End Date]));
Nothing in your code seems to actually be considering the iteration number... perhaps something along the lines of:
addmonths([Start Date], IterNo()-1)
?
i added iterNO to the script but this error appears :
That seems correct - you can't use Max() in the While statement, I suppose. You should grab the max value into a variable and then use that instead.
t creates the different dates but it doesn't match well with the end date and start dates and diffèrent income :