Given a map from a rectangle in the n-dimensional real Euclidean space into a
metric semigroup, we introduce a concept of the total variation, which
generalizes a similar concept due to T. H. Hildebrandt (1963) for real
functions of two variables and A. S. Leonov (1998) for real functions of n
variables, and study its properties. We show that the total variation has many
classical properties of Jordan's variation such as the additivity, generalized
triangle inequality and sequential lower semicontinuity.