Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
urbanfaces
Contributor III
Contributor III

Top N

I have been following the Top N the example on YouTube, but I guess I lost.

 

While the example only looks at Brand and Sales

In my example. I group Function, Name on Sales

When I do the of

 

Rank(Sum(Sales), Function, Name)<=10

It tested for -1 and 0. -1 means the Sales falls within the Top 10

However, when I try to bring the actual result so I can use variable input, it does not work.

This is what I am using to try to filter the column for only the Top 10

Sum(

{<

Function, Name={“= Rank(Sum(Sales), Function, Name)<=10

”}

>}

Sales)

 

Labels (1)
10 Replies
JonnyPoole
Former Employee
Former Employee

Try

Sum( {<Name={“=Rank(Sum(Sales), Function, Name)<=10”}>}  Sales)

or

Sum( {<Function={“=Rank(Sum(Sales), Function, Name)<=10”}>}  Sales)

urbanfaces
Contributor III
Contributor III
Author

Thank you so much, but it does not work. It only pulls the first 10 records in the function group, and the other records are in zero.

JonnyPoole
Former Employee
Former Employee

Yeah I get it. It needs to be filtered in the set modifier based on the rank of the combination of Function and Name, not just function. 

I used some dummy data from help.qlik.com rank topic to do it this way:

Sum( {<ProductMonth={"=rank(Sum(Sales))<=3"}>} Sales)

 

JonnyPoole_0-1710789505992.png

But in order to do this I had to add a concatenated field on both dimensions in the data model 

JonnyPoole_2-1710789640780.png

There is probably another way in the UI to do this which I am curious of. Albeit ideally, it doesn't have nested IF statements or a lot of aggrs(). 

Pallav
Contributor II
Contributor II

Try this -> Sum({<Name={"=Rank(Sum(Sales))<=10"}>}Sales)

urbanfaces
Contributor III
Contributor III
Author

But I want to rank the Sales of the name in the respective Function. Mean, rank the sales for each employee. Name them in each function . Your answer is missing a Function.

theoat
Partner - Creator III
Partner - Creator III

Vous voulez calculer le top 10 des vents pour la combinaison (Function - Nom)?

Imaginons : 

  1. AnalyzeData, Emily, $3500
  2. ManageInventory, Sophia, $2100
  3. UpdateRecords, Olivia, $4500
  4. TrackPerformance, Sophia, $2800
  5. ProcessOrders, Ava, $3700
  6. GenerateReports, Noah, $2300
  7. OptimizeSales, Sophia, $4800
  8. MonitorStock, Liam, $3000
  9. AnalyzeData, Isabella, $3200
  10. ManageInventory, Liam, $1900
  11. UpdateRecords, Liam, $4200
  12. TrackPerformance, Alexander, $2600
  13. ProcessOrders, Charlotte, $3800
  14. GenerateReports, Alexander, $2400
  15. OptimizeSales, Alexander, $4900

Vous voulez afficher :

  1. OptimizeSales, Alexander, $4900
  2. ProcessOrders, Ava, $3700
  3. OptimizeSales, Sophia, $4800
  4. UpdateRecords, Olivia, $4500
  5. UpdateRecords, Liam, $4200
  6. AnalyzeData, Emily, $3500
  7. ProcessOrders, Charlotte, $3800
  8. MonitorStock, Liam, $3000
  9. TrackPerformance, Sophia, $2800
  10. GenerateReports, Noah, $2300

    Enjoy your Qlik.

    Kind regards,
    Théo ATRAGIE.



urbanfaces
Contributor III
Contributor III
Author

Oui, je souhaite calculer la valeur TOP N en fonction de leur groupe de fonctions respectif. La mesure est la valeur.
Chaque Fonction a un employé avec une valeur.
Votre exemple est parfait.

urbanfaces
Contributor III
Contributor III
Author

Yes, I want to calculate the TOP N Value based on their respective function group. The measure is the Value.
Each Function has an employee with a value.
Your example is perfect.

urbanfaces
Contributor III
Contributor III
Author

But I want it to exclude those records that are not in the Top N