Hello,
We can't do the directly assigning the view name as field contains value in InfoPath. While creating the view we have to give the view name and if we want to change the view name then we have to modify it in design mode only.
We can shift the view based on field value using code.
XDocument.View.SwitchView("View Name");
In above line you can assign the value of field1 or field2 depends on your requirement.