if() only results in the last option

Fiz um aplicativo de controle de vendas Appsheet, em que cada produto possui 3 preços possíveis diferentes, dependendo do cliente. 
Na tabela Carrinho de Compras, fiz uma coluna virtual chamada “PrecoUnitário” para calcular o preço do produto referenciado na tabela de produtos e depois adicionar em outra coluna de total. 
Com apenas um valor está funcionando, agora quando coloco a fórmula IF ele considera apenas a última opção da fórmula:IF([Tabela] = "Tabela1", [Produto].[Preco1], IF([Tabela] = "Tabela2" 
, [Produto].[Préco2],[Produto].[Préco3])).

Please show examples of the data, the desired result, and the current actual result.

1 Like

Hello! I have these 3 tables: One that lists products “Produto”, one that registers orders, “Pedidos” and one that opens the shopping cart “Carrinho”.

In the reorder view, the user needs to choose 1 out of 3 possible price lists from the product table.

my problem is when the user chooses one of the price reference tables, because the formula I use is not correct.

THANKS FOR HELPING ME

I do not see any issue with formula. What exactly is the issue that you are seeing? The setup mostly looks fine as well, only thing I can comment on is why is the PrecoUnitario column a virtual column? It can just as easily be a real column, or just skip it all together and add it’s formula into the formula for the Total column.

1 Like

The PrecoUnitario column is virtual because it is composed of a combination of values ​​from two other columns. I thought it was mandatory to be virtual in these cases.

O problema que tenho é que o valor do preço não muda de acordo com a tabela de preços escolhida…, resta apenas a última opção. De qualquer forma, farei as alterações que você sugeriu e darei feedback. Obrigado!

Nope.

Yes, you already said this. I’m looking for additional details.