I'm using latex for my research and I do have a problem. I want to be able to automatically update the values that I mention in the text with values from tables so that when values in the tables change, the values that I mention in the text change as well. I came across this helpful post : Accessing values from tables via "grid search" But yet I'm still struggling to apply it with the following table
\newcommand{\specialcell}[2][c]{\begin{tabularx}[#1]{@{}c@{}}#2\end{tabularx}}
\footnotesize
\newcolumntype{Y}{>{\raggedleft\arraybackslash}X}
\begin{tabularx} {15cm} {@{} l Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y@{}} \\
\toprule
\toprule
\textbf{province}&\textbf{N}&\textbf{Sum}&\textbf{N}&\textbf{Sum} \\
\cmidrule(l{.75em}){2-5}
&Built dataset& &Scotts database& \\
\midrule
Alberta&812&3.9&2790&8.5 \\
British Columbia&2966&14.3&3847&11.8 \\
Manitoba&630&3.0&1014&3.1 \\
New Brunswick&408&2.0&713&2.2 \\
Newfound. \& Labr.&63&0.3&288&0.9 \\
New Scotia&458&2.2&774&2.4 \\
North Territories&1&0.0&7&0.0 \\
Nunavut&3&0.0&6&0.0 \\
Ontario&9040&43.5&13788&42.2 \\
Prince Edward Isl.&30&0.1&145&0.4 \\
Quebec&5968&28.7&8452&25.9 \\
Saskatchewan&393&1.9&844&2.6 \\
Yukon&9&0.0&22&0.1 \\
\textbf{Total}&20781&100.0&32690&100.0 \\
\bottomrule
\bottomrule
\addlinespace[.75ex]
\end{tabularx}
\par
\normalsize
Can somebody help me?

