Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

top n values in current month comparing to previous month

Hi All

please help me out in

Comparing the current month top  n values to the previous months

1 Solution

Accepted Solutions
johnw
Champion III
Champion III

Like this:

sum({<IsRolling3={1},Country={"=rank(sum({<IsCurrent={1}>} Orders),4,1)<4"}>} Orders)

View solution in original post

28 Replies
johnw
Champion III
Champion III

Just a typo, perhaps. You're doing sum(country) instead of sum(Orders).

ecolomer
Master II
Master II

As John, say you need change Country by 2016_11_01_21_48_59_Cortana.pngOrders

Not applicable
Author

Hi john i tried the other  way as well but no luck

Can u pls help me

Not applicable
Author

I didnt get that can you pls explain

ecolomer
Master II
Master II

In your expression you have "country" and is "orders"

Not applicable
Author

Its not geeting yhe correct results

tresesco
MVP
MVP

Perhaps like this:

Capture.PNG

sum({<country={"=rank(Sum({<OrderDate={'>=$(MonthStart(Max(OrderDate))))<=$(=Date(Max(OrderDate)))'}>}Orders))<4"},

OrderDate={'>=$(MonthStart(Max(OrderDate),-2)))<=$(=Date(Max(OrderDate)))'}>}Orders)



Aurelien_Martinez
Partner - Specialist II
Partner - Specialist II

Hi,

Try this expresion : sum({<country={"=rank(aggr(Sum(Orders), country), 4, 1)<=3"}>} Orders)

Aurélien

Help users find answers! Don't forget to mark a solution that worked for you!
johnw
Champion III
Champion III

When I fix the expression as I suggested, I get the results you requested. The only difference I see is they aren't sorted in the order you show. If that's important to you, sort your second dimension like this:

rank(sum({<MonthYear={"$(=max(MonthYear))"}>} Orders),4,1)

I think you can also just use this as your expression:

sum(Orders)