mardi 30 avril 2019

is there a way to expand if statement based on number of rows

I have a form that I'm using for change requests to add "exceptions" I have 3 columns : A - Origin B - Destination C - Number

based on this for each row I have a simple 2 step calculation 1step: Ship lane so simple = A2+" - "+B2 and then if statement: if (Ship Lane= Origin - Destination, then Number)

the if statement is used not in excel but in Tableau so I'm trying get excel to build the if statement if extra lines are added in the ship lane tab.

so the final sentence should look like:

if [Ship lane]= "ABC - DE" then 2
elseif [Ship lane]= "ABC - DK" then 2 
elseif [Ship lane]= "ABC - GB" then 2
END

And if we have extra lines it should add them at the bottom:

if [Ship lane]= "ABC - DE" then 2
elseif [Ship lane]= "ABC - DK" then 2 
elseif [Ship lane]= "ABC - GB" then 2
elseif [Ship lane]= "ABC - IT" then 2
elseif [Ship lane]= "DEF - PL" THEN 1
ELSEIF [Ship lane]= "XYZ - IT" then 1
END 

Aucun commentaire:

Enregistrer un commentaire