Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a field, [Junk Food Eaten], that contains comma separated values.
Date Junk
1/1/2000 Candy, Chips
2/1/2000 Chocolate, White Bread, Soda
I tease out the counts using subfield
Subfield([Junk Food Eaten], ', ') as [Junk]
My problem is when I use mode([Junk]), if there are two strings with the same amount of occurrences, it is returning null.
What I would like is to be able to return both of the tied top results.
Thanks,
Jacob
Try this:
Concat(Aggr(
If(Count(Junk) = Max(TOTAL Aggr(Count(Junk), Junk)), Junk)
, Junk), ',')
Hi,
in case the occurrence is equal, so mode returns by default a null, what would you like the script to return?
on the example you put here, what is the output that you want?
Cheers,
Well if there were 5 instances of Candy and 5 of Chips and they were both the most frequent occurrence, of like it to return Candy, Chips
Try this:
Concat(Aggr(
If(Count(Junk) = Max(TOTAL Aggr(Count(Junk), Junk)), Junk)
, Junk), ',')
Thank you so much, that does it!