Insert Field (Max of a Number Range) into Writer document

I understand how to put in a custom counter throughout my writer document. The procedure is explained in answer to this question here: How can I have a custom numbered field?

I now need to put the maximum displayed by this counter in my document in some other place. Think, a counter counts figures: “Fig 1 […] Fig 2 […]”. Somewhere else I need to say: “This document has x figures.” where x should be automatically inserted from the maximum the counter has ever counted to. As an additional wrinkle, not sure whether that makes a difference, the instance occurs further up in the document before the maximum of the Number Range has been encountered.

Maybe hiding the calculation at the end, and doing a DDE link to these calculation.