Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Count rows in table

I'm trying to create a ranking based of sales. I used the function rowno() but thats not the right one. Goal is to count 1to N based off sales.

Thanks,

1 Solution

Accepted Solutions
johnw
Champion III
Champion III

So even if you have five salespeople that all had exactly $100,000 in sales, you do NOT want them ranked the same??? What distinguishes them, then? Why is Bob ranked #27, but Barbara ranked #31, even though they had the same sales? I don't think you want the rank randomly assigned. Surely it's based on something. That or you SHOULD use the same rank for the same dollar figure.

Can you explain what it was about rowno() that you didn't like? Assuming you sorted by sum([Sales Amount]) in descending order, then rowno() would seem to be similar to the rank, just with the rank assigned by your next sort criteria when salespeople have the same sames. Again, I don't think that's what you should do, but it seems like what you're asking for. Was it that if you then sorted some other way, the "rank" got all messed up? You could always disallow interactive sorting.

View solution in original post

4 Replies
Not applicable
Author

Solved: rank( sum( [Sales Amount] ))

Not applicable
Author

I take that back, it gives the same rank for similar dollar figures ..

Any idea how to just count a row in a table? 1-n?

johnw
Champion III
Champion III

So even if you have five salespeople that all had exactly $100,000 in sales, you do NOT want them ranked the same??? What distinguishes them, then? Why is Bob ranked #27, but Barbara ranked #31, even though they had the same sales? I don't think you want the rank randomly assigned. Surely it's based on something. That or you SHOULD use the same rank for the same dollar figure.

Can you explain what it was about rowno() that you didn't like? Assuming you sorted by sum([Sales Amount]) in descending order, then rowno() would seem to be similar to the rank, just with the rank assigned by your next sort criteria when salespeople have the same sames. Again, I don't think that's what you should do, but it seems like what you're asking for. Was it that if you then sorted some other way, the "rank" got all messed up? You could always disallow interactive sorting.

Not applicable
Author

Great point, I over looked that.

Thanks!