I'm trying to write quotes and depending on "males" selected, it needs to change the output. Unfortunately, in the example below it gives me 2skip although it should give me 2males. What am I doing wrong?
\usepackage{datatool}
\begin{filecontents*}{excel.csv}
included,givenname,matriculation,gender,grade
Maier,Hans,12345,m,1.0
Huber,Anna,23456,f,2.3
Weisbaeck,Werner,34567,m,5.0
\end{filecontents*}
\DTLloaddb{CounterO}{excel.csv}
\begin{document}
\begin{tabular}{lccc}
\DTLforeach*[\DTLiseq{\gn}{m}]{CounterO}%
{\gn=gender}
{%
\DTLiffirstrow{}{\\}
}
\end{tabular}
\newcommand{\CounterA}{\DTLsavelastrowcount{\CounterI{}}}
\CounterA
\ifnum \CounterA > 1
males
\else
\ifnum \CounterA = 1
male
\else
skip
\fi
\fi
\end{document}