Qlik Community

QlikView Documents

QlikView documentation and resources.

Announcements
Support Case Portal has moved to Qlik Community! Read the FAQs to start exploring Support resources.

rank in script

hugmarcel
Specialist
Specialist

rank in script

Hi

see my example file rank.qvw.

- it contains a sub providing flexible ranking mechanisms, such as ranking by autonumber or by row().
- ranks can be split into half ranks for identical values  (e.g. rank 11,12 -> 11.5, 11.5)

- ranking in total, by group and subgroups possible

- it should be easily possible to add more features as "use lowest value", "use highest value" as in UI rank function,

  for identical ranking values.

Regards - Marcel

Attachments
Comments
hugmarcel
Specialist
Specialist

I think you should upload your qvw document to this thread in order to check what the problem is.

0 Likes
ghilenasma
Contributor III
Contributor III

CALL RankQVTable ( 'Sales', 'Clé', 'Qte','[PU € var] desc', 'autonumber' );

fffeerffe.PNG

you can find my file here in the link bellow :

http://https://drive.google.com/open?id=1oYGWDv0XeLY5fkkJSGrJIklfIhkE2DAT

0 Likes
hugmarcel
Specialist
Specialist

Hi

please wait until new rank.qvw file has been accepted by moderator and has been published.

Your example does not work because Cle contains identical values. However, you can use trick:
CALL RankQVTable ( 'Sales', 'Cle', 'RecNo()', '[PU var] asc', 'autonumber' );
if you want to group ranks by Cle, or
CALL RankQVTable ( 'Sales', '',    'RecNo()', '[PU var] asc', 'autonumber' );
if you do not want to group ranks by Cle.

Regards - Marcel

0 Likes
ghilenasma
Contributor III
Contributor III

good morning ,

perfect i think that we are close

i have a good sort but here i can't find good rank

first example should be start from 1

the second i can't find 2  he consider   2.5 rank like 3 and 1.5 like 2

rrrezz.PNG

0 Likes
hugmarcel
Specialist
Specialist

Does your data contain multiple identical rows? Please check the sub for what it is doing. I am in holiday now for 3 weeks sorry.

Best regards Marcel

0 Likes
ghilenasma
Contributor III
Contributor III

Does your data contain multiple identical rows?   =>  YES

sorry if i disturb you

0 Likes
Version history
Revision #:
1 of 1
Last update:
‎2015-11-15 05:39 AM
Updated by: