Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
can any1 explain the below expresion
let varMinDate=Num(Peek('OrderDate',0,'Order'));
let varMaxDate=Num(peek('OrderDate',-1,'Order'));
let Vartoday=Num(today());
DateField:
LOAD
$(VarMinDate)+rowno()-1 as Num,
Date($(varMinDate)+RowNo()-1) as tempdate
AutoGenerate
$(varMaxDate)-$(varMinDate)+1;
Hi, some input here, lets pretend that Your OrderDate is from 2017/01/01 to 2017/12/31
$(VarMinDate)+rowno()-1 as Num, //this will use Your variable VarMinDate as a numeric value and plus the number of rowno(), in this case 0
ex 42736
Date($(varMinDate)+RowNo()-1) as tempdate //This do the same as above but create a date format ex 2017/01/01
AutoGenerate
$(varMaxDate)-$(varMinDate)+1 //this will autogenerate rows, in Your case 43100-42736=364+1, which is Your OrderDates
43100 is 2017/12/31
So this will create a calendar for you With Your OrderDate, important as Thomasz says: Order table need to be sorted asc as you use peek
There must be Order table with OrderDate field, Zero in peek means it gets first OrderDate value, -1 means it takes last one. Then it generated dates between, but I would check if OrdreDate is sorted.
thanks
can u explain this part
$(VarMinDate)+rowno()-1 as Num,
Date($(varMinDate)+RowNo()-1) as tempdate
AutoGenerate
$(varMaxDate)-$(varMinDate)+1
without data it will be difficult to the members to help you out, please take some time to provide sample data if possible.
Hi, some input here, lets pretend that Your OrderDate is from 2017/01/01 to 2017/12/31
$(VarMinDate)+rowno()-1 as Num, //this will use Your variable VarMinDate as a numeric value and plus the number of rowno(), in this case 0
ex 42736
Date($(varMinDate)+RowNo()-1) as tempdate //This do the same as above but create a date format ex 2017/01/01
AutoGenerate
$(varMaxDate)-$(varMinDate)+1 //this will autogenerate rows, in Your case 43100-42736=364+1, which is Your OrderDates
43100 is 2017/12/31
So this will create a calendar for you With Your OrderDate, important as Thomasz says: Order table need to be sorted asc as you use peek
Thank you so much,it helped to me to understand in right manner