Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
i am trying to get count of orders for last 30 days by Team in script (not by set analysis).
When using below expression, i am getting Rank for Orders num by Team but for Orders which have distance between them <= 30Days, (keyDate is order date, $keyDate_Plus_30D is Order date plus 30 Days, Team is Order create Team)
if ( peek($keyDate_Plus_30D)>=$keyDate AND peek(Team)=Team, Peek('My_30D_Rank')+1,1) as My_30D_Rank
Solved it with following:
if ( peek($keyDate, (-1)* Peek('My_30D_Rank')+1) >= ($keyDate-30)
AND peek(Team)=Team, Peek('My_30D_Rank')+1,1)
as My_30D_Rank
Solved it with following:
if ( peek($keyDate, (-1)* Peek('My_30D_Rank')+1) >= ($keyDate-30)
AND peek(Team)=Team, Peek('My_30D_Rank')+1,1)
as My_30D_Rank