Opal-1673: Copy categories when deriving variables