Domanda

Mode function in QlikView will return the mode element in array, only if there is only one. If there is more than one it returns null.

I need to return list of Modes in someway in a expression.

How can I return the list of modes in a multimodal set like:

1 3 3 5 5 7 9

I would to return 3, 5. So I can take Min, or Max, or Avg..

È stato utile?

Soluzione

I just needed to read up on Multimodals, so correct me if I'm wrong. This expression returns the highest of the two values that has the highest number of occurances (right?):

Max( 
 Aggr ( 
  if (count( Num)>=Max(total Aggr(count( Num),Num)) ,Num),
  Num)
)

I use the Aggr function to create the list to pick from. So change the first Max to whatever you want to pick.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top