How to create formula of Y/N list?

Hi all,

I created a column, with Y/N list type.

I also rename it to Y = Inbound, N = Outbound
So
i want that when we choose Y, the amount key in output will be positive,
i want that when we choose N, the amount key in will output be negative,

How should i set that?

0 8 139
8 REPLIES 8

Can you elaborate on what you mean by the “amount key”?

Aurelien
Google Developer Expert
Google Developer Expert

I guess this is an amount value to attribute positive or negative depending on the Y/N ?

If so, the expression might be:

IF([inbound_yes_no],
  [Amount],
  -1*[Amount]
)

Yesm it is what i mean,

Unfortunately, I tried, but failed

could you help to see my reply with screenshot? see if it could be better for understanding?

ok, thanks for the screenshot.
That provides further explanation and context to your initial question

I think you want to use a virtual column in the inventory table.
this will be:
amount_VC expression:

IF([Order ID].[in / out],
  [Amount],
  -1*[Amount]
)

thank you so much for your reply.
the fomula works, but it doesnt change to negative

anywhere wrong?

I did try this too, but result same

IF([Order ID].[in or out]=FALSE,
[Amount],
-1*[Amount]
)

the amount you type will be the amount written in the sheet, as it is a “real column”.
You may want to consider using one more column, the “corrected_amount”, and set the expression I gave above on it, in the “App Formula” field instead of “initial value” field.

Or, if the data are not supposed to be used somewhere else outside appsheet, you may want to use a virtual column ==> not written, but calculated only.

I have attached a screenshot
see if it could be better understanding.

basically, when I click inbound, i need the amount to be positive outcome
when i click outbound it will become -ve outcome

ok i add another column label it quantity, it doesnt look nice but it serve the purpose.
thank you so much!

appreciate your time

Top Labels in this Space