Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anatoli
Contributor
Contributor

Rank over last 30days

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

Labels (2)
1 Solution

Accepted Solutions
Anatoli
Contributor
Contributor
Author

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

View solution in original post

1 Reply
Anatoli
Contributor
Contributor
Author

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