Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Mode shows 2 or more values

Hey everyone,

It´s commonly known that the mode() function gives the most occurring value and gives a NULL value when 2 or more values share the same amount of occurrences. Is there any way to make the mode function show those two values, or at least one of them?

If possible, I'm okay with another expression. It's not necessary for me to use the mode() function.

Thanks in advance!

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Have you tried something like

=Concat(Aggr( If(Count(WEEKDAY)=Max(TOTAL<DEBTOR> Aggr( Count(WEEKDAY),DEBTOR, WEEKDAY)),WEEKDAY), DEBTOR,WEEKDAY),', ')


Used in a table chart with DEBTOR as dimension.


Essentially, you need to get the grouping entities right.


Sample data will probably help to solve your issue.

View solution in original post

4 Replies
swuehl
MVP
MVP

Maybe like

=Concat(Aggr( If(Count(VALUE)=Max(TOTAL Aggr( Count(VALUE),VALUE)),VALUE),VALUE),', ')

Not applicable
Author

Thanks for your reply Stefan!

This expression doesn't work unfortunately.
It gives me an output, but combines values that aren't even the most occurring 😕

Maybe I can give more info on my problem.

I want to show the most occurring weekday per debtor. This way I can see on what day the debtor is online the most.

For a lot of values I get one day as output. And for some I get a null value, because there are 2 or more days that occur the most.

swuehl
MVP
MVP

Have you tried something like

=Concat(Aggr( If(Count(WEEKDAY)=Max(TOTAL<DEBTOR> Aggr( Count(WEEKDAY),DEBTOR, WEEKDAY)),WEEKDAY), DEBTOR,WEEKDAY),', ')


Used in a table chart with DEBTOR as dimension.


Essentially, you need to get the grouping entities right.


Sample data will probably help to solve your issue.

Not applicable
Author

This worked!

Thanks!