Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi folks,
I made mistake in my script and don't know where,
so i create a script to generate weeks between two dates
MinMaxDate:
LOAD
%_KEY,
MIN(StartWeek) AS MinDate,
MAX(weekstart(Today())) AS MaxDate
RESIDENT WI
GROUP BY %_KEY
JOIN (WI)
LOAD
%_KEY,
iterno()+MinDate as Dim_WI.StartWeek
RESIDENT MinMaxDate
While iterno()+ MinDate <= MaxDate;
And it's generate only days between, could you please help ?
@Micki try below
MinMaxDate:
LOAD
%_KEY,
MIN(StartWeek) AS MinDate,
MAX(weekstart(Today())) AS MaxDate
RESIDENT WI
GROUP BY %_KEY
JOIN (WI)
LOAD
%_KEY,
Weekstart(MinDate,iterno()-1) as Dim_WI.StartWeek
RESIDENT MinMaxDate
While Weekstart(MinDate,iterno()-1) <= MaxDate;
@Micki how weeks should look like?
Hi @Kushal_Chawda , I am using with weekstart() so format: 05/10/2020 , 12/10/2020 and so on
@Micki try below
MinMaxDate:
LOAD
%_KEY,
MIN(StartWeek) AS MinDate,
MAX(weekstart(Today())) AS MaxDate
RESIDENT WI
GROUP BY %_KEY
JOIN (WI)
LOAD
%_KEY,
Weekstart(MinDate,iterno()-1) as Dim_WI.StartWeek
RESIDENT MinMaxDate
While Weekstart(MinDate,iterno()-1) <= MaxDate;
@Kushal_Chawda Thank you! it's working