Generate consecutive Sundays
Example
Generate the Sunday sequence from 20200201 to 20200430, and the result is shown in the following figure:
Write SPL script:
A 

1 
>start=date("20200201") 
2 
=pdate@w(start) 
3 
>start=if(A2<start,A2+7,A2) 
4 
=periods@x(start,"20200430",7) 
A1 Define the variable start as the start date 20200201
A2 Calculate the Sunday of the week of the start date, option @w means get the Sunday of the week of the specified date
A3 If A2 is less than the start date, let start be A2+7, which is the next Sunday, otherwise let start be A2
A4 Generate a date sequence with a 7day interval between the start Sunday start and the end date 20200430, that is, a sequence of consecutive Sundays within the specified start and end time period. The option @x means that the backend date is not included 20200430
Chinese version