Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
[ExpenseEnd Date] > MonthStart(addmonths(ExpenseStartDate, ExpenseFrequencyNum*(iterno()-1)));
Trying to understand the above script.What exactly it is doing ?
ExpenseEnd Date = 12/31/2020
ExpenseStartDate = 1/1/2016
ExpenseFrequencyNum = 1
Thank you.
It seems like you are adding the missing Month between 12/31/2020 and 1/1/2016.
So starting with 1/1/2016, every While loop will add a month to it until it reaches 12/31/2020
First While Loop -> 1/1/2016
Second While Loop -> 2/1/2016
Third While Loop -> 3/1/2016
.
.
.
and so on.
Iterno() returns the current cycle count value in a LOAD... WHILE...; statement.
If the expression you posted is part of the WHILE condition, then the LOAD will generate rows for 1/1/2016, 2/1/2016, up to 12/1/2020. With the current lack of context details, that's about as much explanation I can give you.
Best,
Peter
An example of how to use While and IterNo() can be found on Creating Reference Dates for Intervals.
HIC