Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am trying to get the value glf_cod corresponding to the highest count of lic_cod for each glf_cod.
I always get a null result when trying the following :
FirstSortedValue(DISTINCT glf_cod,-Aggr(count(lic_cod),glf_cod))
I have tried with and without Distinct and there is no tie for the first value.
Does anyone have an idea of what I seem to be doing wrong please ?
It may be this
=FirstSortedValue(DISTINCT glf_cod,-Aggr(Count(lic_cod ),glf_cod),1)
Hi Peter,
Thanks for the answer but it still does not work :
=Max(AGGR(Count(DISTINCT glf_cod ),lic_cod ))
Hi Pierre, thanks for your help but this returns the lic_cod with the most glf_cod associated with it.
I'm looking for the glf_cod where there are the most lic_cod (kind of the other way aroung from what you proposed).
Max(AGGR(Count(DISTINCT lic_cod ),glf_cod )) would give me the highest count of lic_cod for the right glf_cod but I'm looking for the glf_cod, NOT the count associated with. FirstSortedValue would solve my problem but it keeps returning Null for a reason I don't get.