Save the date! Join us on October 16 for our Product Ops launch event. Register here.
May 25, 2022 08:27 AM
Hello,
I would like to set up a calculation to allow me to multiply a number according to conditions. IF(), but I don’t know how to go about it.
Here is the request:
My column: ( hide) Inventaire Composant sortant (Unique) corresponds to a set of products: ex: 1 table. "I could have called this ( hide) Inventaire Produit fini sortant (Unique) → This is what I take out of my stock but as a product as a whole (single).
The question is for my column: Inventaire composant sortant ( Calcul pied), I would like according to conditions to be able to say if table with 2 feet, multiplies (( hide) Inventaire Composant sortant (Unique)) x 2 (# (hide)Pieds), if table with 3 feet, multiplies (( hide) Inventaire Composant sortant (Unique)) x 3 (# (hide)Pieds), if 4-foot table, multiplies (( hide) Inventaire Composant sortant (Unique)) x 4 (# (hide)Pieds), idem for if 1 feet and if Blank(), leave the field empty
This would then allow me to subtract Inventaire composant sortant ( Calcul pied) from ( hide) Inventaire Composant sortant (Unique) and have the result of my “Composants en Stocks”
Can someone help me, thank you very much :heart_eyes:
Solved! Go to Solution.
May 26, 2022 04:10 AM
May 25, 2022 10:32 AM
Hi Melissa! While I don’t completely understand what you’re trying to achieve (where is the amount of feet coming from?), usually using SWITCH() is much easier than a nested if statement. Hope that helps and otherwise just post here again :slightly_smiling_face:
May 25, 2022 02:02 PM
Hi Rupert,
I forgot to add these printscreen “ #(hide) Pieds”
I reformulated my question and changed the printscreen
Hope you can help me
Thank you
May 25, 2022 02:58 PM
Hi @Melissa1 ,
As @Rupert_Hoffschmidt stated, the Switch() can also be used. I think I got your field names correct.
IF({(hide) Pieds} = 2, {( hide) Inventaire Composant sortant (Unique)}*2, IF({(hide) Pieds} = 3, {( hide) Inventaire Composant sortant (Unique)}*3, IF({(hide) Pieds}=4, {( hide) Inventaire Composant sortant (Unique)}*4, '')))
May 26, 2022 03:09 AM
Just to show you how this would look with SWITCH():
SWITCH({(hide) Pieds},
2, {( hide) Inventaire Composant sortant (Unique)}*2,
3, {( hide) Inventaire Composant sortant (Unique)}*3,
4, {( hide) Inventaire Composant sortant (Unique)}*4
)
But since you’re multiplying by the number of legs, it doesn’t make much sense. You could have a much easier IF statement (if I’ve understood things correctly):
IF({(hide) Pieds} != 0, {(hide) Pieds}*{( hide) Inventaire Composant sortant (Unique)}, "")
May 26, 2022 04:10 AM
Thank you very much, you solved my problem :star_struck:
May 26, 2022 04:11 AM
Thank you for your help :slightly_smiling_face: