Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
bharathkamath28
Contributor III
Contributor III

show only one value based on count and alphabetical order

Hi ,

I have a requirement to show single value in text box in qliksense based on two conditions.

1.return name based on max count(Path)

2. If multiple name has same count(Path) then pick alphabetical order of name.

If the input is

bharathkamath28_0-1613997851841.png

 

Return : ryan in text box as count(distinct Path) is more

If the input is 

bharathkamath28_1-1613997923431.png

 

return: Andrew as count(Path)=3 in both the Names, so pick Andrew alphabetically.

Any suggestions are much appreciated.

 

Thanks,

Bharath

Labels (1)
1 Solution

Accepted Solutions
Taoufiq_Zarra

@bharathkamath28 Maye be like :

=FirstSortedValue(distinct Name,-aggr(count(Path)+Rank(Name,Name)/10,Name))

Examples :

Taoufiq_Zarra_0-1614001212238.png

Taoufiq_Zarra_1-1614001241260.png

Taoufiq_Zarra_2-1614001323730.png

 

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉

View solution in original post

3 Replies
Taoufiq_Zarra

@bharathkamath28 Maye be like :

=FirstSortedValue(distinct Name,-aggr(count(Path)+Rank(Name,Name)/10,Name))

Examples :

Taoufiq_Zarra_0-1614001212238.png

Taoufiq_Zarra_1-1614001241260.png

Taoufiq_Zarra_2-1614001323730.png

 

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
bharathkamath28
Contributor III
Contributor III
Author

Thanks @Taoufiq_Zarra 

What if we want to show only those paths as a dimension in the table.

How can we achieve this?

Taoufiq_Zarra

@bharathkamath28  you can use Aggr function

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉