Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

Rank ?

Hi All,

How to Calculate in Rank in Back end Scripting  for the Getting the TOP 10 Customers...

Kindly help me on this...

Regards,

Helen

14 Replies

Re: Rank ?

Would you be able to share a sample where it can be demonstrated?

sinanozdemir
Valued Contributor III

Re: Rank ?

As sunindia indicated it would be better if you could share a sample. Although, you want to see a working example, here is one for you:

In the back-end, I usually use Peek() function to rank the records:

Capture.PNG

This will give you the below data model:

Capture.PNG

And in the front-end, you can use nest Rank() with Aggr():

Capture.PNG

You use 1 in the set analysis so that ranking doesn't change based on users' selections.

I am attaching the qvw, hope this helps.

Re: Rank ?

Just to add to what Sinan‌ mentioned, I have also used AutoNumber() function to create Rank, but it all depends on what is the exact requirement

qlikrajan
Contributor III

Re: Rank ?

use order by in script to arrange your field value in a particular order (ASC or DESC) and then use rowno() function to identify the rank. Let me know if it helps.

Not applicable

Re: Rank ?

HI Sinan,

Thanks..

But I need to bring Top Customers, on the basis of Last 12 Months in back end, I need to show them in front ENd ..with Salesvalue

Regards,

Helen

Re: Rank ?

You mean to say, customers having sales in last 12 months?

Not applicable

Re: Rank ?

Customers who are having top Sales in last 12 Months, I need to bring 10 Customers as Out put..

Last 12 MOnths: Sep-2014  to Aug 2015 having top Sales

Regards,

Helen

Re: Rank ?

can you share some sample data?

Not applicable

Re: Rank ?

U can use this..

Community Browser