When you sell your house or flat, you have to pay tax on the net profit. The amount is calculated differently from canton to canton.