Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear All,
How do I calculate the end dates via load script,Pls help.
I tried Keep & Previous but the result starts in PeriodNumber2
Type:
LOAD PeriodStart-1 as PeriodEnd,
* INLINE [
PeriodNumber,PeriodStart
1,2013-01-01
2,2013-01-28
3,2013-02-25
4,2013-04-01
5,2013-04-29
6,2013-05-27
7,2013-07-01
8,2013-07-29
9,2013-08-26
10,2013-09-30
11,2013-10-28
12,2013-11-25
SourceData:
LOAD * INLINE [
PeriodNumber,PeriodStart
1,2013-01-01
2,2013-01-28
3,2013-02-25
4,2013-04-01
5,2013-04-29
6,2013-05-27
7,2013-07-01
8,2013-07-29
9,2013-08-26
10,2013-09-30
11,2013-10-28
12,2013-11-25];
Type:
Load *,
Alt(peek('PeriodStart'), today()) as periodend
Resident SourceData
Order by Period desc;
Drop table SourceData;
SourceData:
LOAD * INLINE [
PeriodNumber,PeriodStart
1,2013-01-01
2,2013-01-28
3,2013-02-25
4,2013-04-01
5,2013-04-29
6,2013-05-27
7,2013-07-01
8,2013-07-29
9,2013-08-26
10,2013-09-30
11,2013-10-28
12,2013-11-25];
Type:
Load *,
Alt(peek('PeriodStart'), today()) as periodend
Resident SourceData
Order by Period desc;
Drop table SourceData;
Thanks,Problem solved.