Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
nareshthavidishetty
Creator III
Creator III

Rank in text object

Hi all,

I am new to Qlikview and I have a requirement like, i want to show particular product rank for each  country.

Ex:

Country   Product   Sales

US          P1              10

US         P2              20

US        P3              30

US         P4              40

UK         P1              100

UK          P2               800

UK        P3              400

UK         P4               400

O/P :

In Text Object:   US - 2 nd RANK for  Product(P2)

                         UK- 1st  RANK for   Product(P2)

Thanks and Regards,

Naresh

16 Replies
antoniotiman
Master III
Master III

Try

=Concat(DISTINCT  Country,Chr(10), Aggr(NODISTINCT Rank(Sum({<Product={'P2'}>} Sales),4),Country ))

Regards,

Antonio

maniram23
Creator II
Creator II

Hi,

Try This one .

Aggr(Rank(Sum(Sales)),Country)

or

Only({<Product = {'P2'}>} Aggr(Rank(Sum(Sales)), Country))

Regard

tyagishaila
Specialist
Specialist

Dim:    Country and Product

Expression:    Rank(aggr(Sum(SalesRank),ProductRank,CountryRank))             if you want max Sale rank 1

or    Rank(aggr(-Sum(SalesRank),ProductRank,CountryRank))                          if you want min Sale rank 1

tyagishaila
Specialist
Specialist

to display rank in Text Object, you can create Rank in script

by using rowno() and order of Sales as asc.

Try it once,

Hope it will work!

vikasmahajan

See Attached Details document on RAnk hope this helps you

Vikas

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.
nilapril2010
Contributor III
Contributor III

Hi,

Please check with this

=Concat('US',Aggr(Rank(Sum({<Country={'US'}, Product={'P2'}>} Sales)),Country,Product),'RANK for  Product(','P2',')')

Regards

Nilanjan

qlikview979
Specialist
Specialist

Hi If you want in Text Object

Try this

='Rank for Product '&only(Product)&': '&aggr(rank(TOTAL sum({1} Sales)), Country)

nareshthavidishetty
Creator III
Creator III
Author

Hi Antonia,

Thanks for your quick reply,

Could you please find the attachment of sample QVW

@ !

antoniotiman
Master III
Master III

See Attachment.

Regards,

Antonio