Currently, there is a Danish State Visit to Vietnam going on. This involves both the Queen and the Crown Prince – which means that according to Danish law, someone has to be home in Denmark to mind the store, so to speak. This time around, Prince Joachim was the fortunate one.
The purpose of this is that there should always be someone in Denmark who can “lead the government.” These days the government can probably lead itself, but these are the kind of formalities that monarchies run on. Come to think of it, this is the kind of formality that governments in general run on.