If condition in a view

If condition in a view

Hi!

I have a field in a view that depends on the values of two other fields and I need to show diferent values.

My if condition is:

  1. if (input.Preco_jumbo  >  input.Preco_continente)
  2. {
  3.     Mais_barato = "Continente";
  4. }
  5. else
  6. {
  7.     Mais_barato = "Jumbo";
  8. }

My question is where should be this statement? In the form field associated to an action like on add/edit or in the view script?