Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

aashish591
New Contributor II

how to get the rank of a dataset?

Dear all,

i have a table in which i want to know the rank of each dataset..

how to achieve that.

Regards,

aashish

1 Solution

Accepted Solutions
sushil353
Honored Contributor II

Re: how to get the rank of a dataset?

ok..

try this:

t1:

load * inline

[

customer,purchase

a,10

a,20

b,30

c,40

];

t2:

load *,

autonumber(purchase) as rank

resident t1

order by purchase desc;

drop table t1;

HTH

Sushil

5 Replies
sushil353
Honored Contributor II

Re: how to get the rank of a dataset?

if you are calculating in chart then you can use rank() function...

if it is in script then use autonumber to generate the ranks for each dataset..

HTH

Sushil

aashish591
New Contributor II

Re: how to get the rank of a dataset?

i want to implement it in script level...

data is like:

customer, purchase

a,10

a,20

b,30

c,40

Thanks!

Not applicable

Re: how to get the rank of a dataset?

Hi Aashish,

Can you please elaborate the problem... however you can try "rank" function...

Best Regards

sushil353
Honored Contributor II

Re: how to get the rank of a dataset?

ok..

try this:

t1:

load * inline

[

customer,purchase

a,10

a,20

b,30

c,40

];

t2:

load *,

autonumber(purchase) as rank

resident t1

order by purchase desc;

drop table t1;

HTH

Sushil

aashish591
New Contributor II

Re: how to get the rank of a dataset?

Thank you!!

Community Browser