Counting values

Hi everyone!

I’m doing some analysis and I have this situation:

I want to “detect” that someone (column “nomeLimpo”) has the same supervisor at the Master and Ph.D. degree. In the example below, “Adriana Luiza” has got PhD and Master (column “formacao”) with the same supervisor (id 816 at “orientacao” columnm).


Something like

if count (“formacao”) >=2 AND count(“orientacao”) == 1

Is it possible?

Thanks in advance!



I guess “formacao” and “orientacao” are reference lists to the same “persons” table ; in that case, rather than counting, wouldn’t it be easier to compare lists ?

for f in $formacao:
  if f in $orientacao:
    return True
return False

Otherwise, to count items in a field, you may use the len() function of Python:

len($formacao) == len($orientacao)

Here is a sample document with conditional style for both columns.

Perfect! I got this:

len($formacao) >1 and len($orientacao) == 1

Works perfectly! Thanks!