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

Help with an expression

Hello.

I need to group clients by product category. For that i have a straight table with ID in first column, concatenated categories  in the second, and in the third column i need the name of the category which occurs most in the second column.

How do i find the rank of eatch CatName in column 2 (by row, not column) and display the one with highest rank in column 3?

Clientconcat(CatName,',')Group
1Cat1,Cat1,Cat2,Cat3Cat1
2Cat1,Cat2,Cat2Cat2
3Cat1,Cat2,Cat3
4Cat1,Cat1,Cat1,Cat2Cat1
5Cat1,Cat2,Cat3;cat3Cat3

Thanks in advance.

question.jpg

1 Solution

Accepted Solutions
Not applicable
Author

Hi,

For that we have a function which returns the most occurring value. The function name is mode().

in your scenario you can use it as mode(CatName) in your third column.

..

Ashutosh

View solution in original post

2 Replies
Not applicable
Author

Hi,

For that we have a function which returns the most occurring value. The function name is mode().

in your scenario you can use it as mode(CatName) in your third column.

..

Ashutosh

Not applicable
Author

Thank you. Your reply was quick and correct I had no idea this sort of function existed.