Help about if statement in constraint block

In reply to Reuben:

You still have the first three b4 constraints backwards. But you can delete them. You only need solve cmd before data;