In this post I found some working code that I am now using quite frequently:
\documentclass{article}
\usepackage{pgfplotstable}
\begin{document}
\pgfplotstableread{
num value
1 2
2 5
1 3
3 2
1 4
2 1
}\data
\pgfplotstabletypeset[row predicate/.code={%
\pgfplotstablegetelem{#1}{num}\of{\data}
\ifnum\pgfplotsretval=1\relax
\else\pgfplotstableuserowfalse\fi}]{\data}
\end{document}
However, I would like to make a \newcommand that implements this, but where the table it should use (\data in this example) is an argument.
Of course, this conflicts with #1's other meaning, being the first argument of my function. Is there a remedy?
