Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
yyw
Contributor
Contributor

Ranking not work correctly

I am building a straight table to show top 10 orders, and also includes their information (such as product, customer).

I've tried these 2 methods but both of them did not get the correct top orders.

1. Click the order_number and limit to top 10.

2. Use Ranking expression.

The formula I used:

=AGGR(

RANK(

Sum(

{<

                BUSINESS={'A', 'C', 'D'},

    YEAR={$(=YEAR(TODAY()))},

    MTD_FLAG={'Y'}

>}

ORDER_AMOUNT

)

,0,1),

BUSINESS,

ORDER_NUMBER

)

 

 

Labels (1)
3 Replies
Daniel_Castella
Support
Support

Hi @yyw 

 

The first one should always work if the limitation is being done on the correct calculation. For the second one, I would need to see the raw data to reproduce it. Could you, please, attach it or the app with the object if possible?

 

Kind Regards

Daniel

Vegar
MVP
MVP

It is a bit hard to troubleshoot without knowing more about the data and your selections.

What is MTD orders? Is it an expression or a recalculated dimension value? How is that calculation done?

 

I notice this set modifier:

YEAR={$(=YEAR(TODAY()))},  MTD_FLAG={'Y'}

The screenshot reveal nothing about those values in your selections. Could it be that the "faulty" blank doesn't meet the correct YEAR and MTD_FLAG criteria?

Chanty4u
MVP
MVP

Use this in calculated dimension 

=If(

  Aggr(

    Rank( 

      Sum({<BUSINESS={'A','C','D'}, YEAR={$(=Year(Today()))}, MTD_FLAG={'Y'}>} ORDER_AMOUNT)

    ,0,1),

    ORDER_NUMBER

  ) <= 10,

  ORDER_N

UMBER

)