iterate over dataset.variables in reduce