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

Straight Table row data in Text Box

I have a straight table with Dimension as 

Dim: =If(Aggr(Rank(Count(DISTINCT{$<Type={'Sale'}>}(ID))) <= 5,EID),EID)

 

Expression: Count(DISTINCT{$<Type={'Sale'}>}(ID))

 

This is to show only top 5 EIDs in the Straight Table that has the most number of IDs

 

How do I show the top most EID and number of IDs this EID has in a Tex Box?

Labels (3)
1 Solution

Accepted Solutions
MayilVahanan

Hi @qlikwiz123 

May be try like below

=FirstSortedValue(EID, aggr(rank(Count(DISTINCT{$<Type={'Sale'}>}ID),4),EID))

which gives Top most EID info.

Or

=aggr(if(Rank(Count(DISTINCT{$<Type={'Sale'}>}ID))=1, EID, EID)

------------

Below exp. gives the number of IDs of that EID

Aggr(If(rank(Count(DISTINCT{$<Type={'Sale'}>}ID),4) = 1, Count(DISTINCT{$<Type={'Sale'}>}ID)),EID)

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

4 Replies
MayilVahanan

Hi @qlikwiz123 

May be try like below

=FirstSortedValue(EID, aggr(rank(Count(DISTINCT{$<Type={'Sale'}>}ID),4),EID))

which gives Top most EID info.

Or

=aggr(if(Rank(Count(DISTINCT{$<Type={'Sale'}>}ID))=1, EID, EID)

------------

Below exp. gives the number of IDs of that EID

Aggr(If(rank(Count(DISTINCT{$<Type={'Sale'}>}ID),4) = 1, Count(DISTINCT{$<Type={'Sale'}>}ID)),EID)

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
qlikwiz123
Creator III
Creator III
Author

 Works as expected. Thank you very much.

qlikwiz123
Creator III
Creator III
Author

Hi @MayilVahanan ,

Just like FirstSortedValue, do we have anything to show Top 2nd, Top 3rd etc similar to what we show using FirstSortedValue?

MayilVahanan

Hi @qlikwiz123 ,

You can use rank () function or in firstsortedvalue function itself, u can provide rank..

Pls refer in below link

https://help.qlik.com/en-US/qlikview/April2020/Subsystems/Client/Content/QV_QlikView/ChartFunctions/...

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.