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])).

 

0 5 140
5 REPLIES 5

Marc_Dillon_0-1693076928141.png

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

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

btelles_0-1693273229105.png

btelles_1-1693273292101.pngbtelles_2-1693273342840.png

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

btelles_3-1693273889486.pngbtelles_4-1693273924524.png

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

btelles_5-1693274314598.pngbtelles_6-1693274345903.png

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.

 

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!


@btelles wrote:

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.


Nope.


@btelles wrote:

The problem I have is that the price value does not change according to the chosen price list..., only the last option remains.


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