Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello, I am sure this is pretty easy, but I want to create a table in the script and have it list dates every 14 days from a min date found in table A to the Max Date table A.
Thanks,
Something Like This
Change vLastDate logic based on your requirement
Let vlastDate='05/26/2017';
If Today()-'$(vlastDate)'=14 Then
Table:
Load * inline [
Date
5/03/2017
6/28/2017
];
NoConcatenate
Table2:
Load
Max(Date) as Max_Date,
Min(Date) as Min_Date
Resident Table;
LET vStartDate = num(Peek('Min_Date'));
LET vEndDate = num(Peek('Max_Date'));
Drop Tables Table,Table2;
TempCalendar:
LOAD
$(vStartDate) + RowNo() - 1 AS Num,
date($(vStartDate) + RowNo() - 1) AS TempDate
AUTOGENERATE
$(vEndDate) - $(vStartDate) + 1;
Else
EXIT Script;
AAR, thank you for this and actually very accurate based on my title, but I want to generate dates in 14 day increments, IE Jan 1 Jan15 Jan 29 etc...
Hi Bill
Table:
LOAD * Inline [
MinDate,MaxDate
01/01/2016,01/06/2016
01/01/2017,01/06/2017 ];
Date:
LOAD (MinDate + (IterNo()-1)*14) as Date
Resident Table
While (MinDate + (IterNo()-1)*14) <= MaxDate;
Regards,
Antonio