# QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for
Search instead for
Did you mean:
Highlighted
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
Highlighted
MVP

Like this:

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

28 Replies
Highlighted
MVP

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

Highlighted
Master II

As John, say you need change Country by Orders

Highlighted
Not applicable

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

Can u pls help me

Highlighted
Not applicable

I didnt get that can you pls explain

Highlighted
Master II

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

Highlighted
Not applicable

Its not geeting yhe correct results

Highlighted
MVP

Perhaps like this:

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

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

Highlighted
Partner

Hi,

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

Aurélien

Highlighted
MVP

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)