AbstractLet be a nilpotent algebra of class two over a compact discrete valuation ring of characteristic zero or of sufficiently large positive characteristic. Let be the residue cardinality of . The ideal zeta function of is a Dirichlet series enumerating finite‐index ideals of . We prove that there is a rational function in , , , and giving the ideal zeta function of the amalgamation of copies of over the derived subring, for every , up to an explicit factor. More generally, we prove this for the zeta functions of nilpotent quiver representations of class two defined by Lee and Voll, and in particular for Dirichlet series counting graded submodules of a graded ‐module. If the algebra , or the quiver representation, is defined over , then we obtain a uniform rationality result.