Forum Discussion
Anonymous
6 years agoNot applicable
New Column Based on different values
Hi dear Community! Seeking your help again. I want to add next column, which case would be for instance: if Column named Branch equals 03 and 04 this should add Spain, and if equals 31, 34, 82,...
- Anonymous6 years ago
Anonymous
Please select branch number column and go to modeling tab and change the data type of Branchnumber from text to numberOR
Use value function
BU = SWITCH(TRUE();VALUE(SOMA[Branch Number]) IN {030;042}; "Spain ";VALUE(SOMA[Branch Number]) IN {031;034; 082;083;085;402}; "France";"UNKNOWN")
OR in case if you want branchnumber field to be text type onlyBU = SWITCH(TRUE();SOMA[Branch Number] IN {"030";"042"}; "Spain ";SOMA[Branch Number] IN {"031";"034"; "082";"083";"085";"402"}; "France";"UNKNOWN")
Anonymous
6 years agoNot applicable
Hi Anonymous
I have applied the function, but i get an error: "Table constructor cannot have optional argument"
Bellow I include the full formula in case I am m issing something.
BU = SWITCH(TRUE();
SOMA[Branch Number] IN {030;042}; S"pain ";
SOMA[Branch Number] IN {031;034; 082;083;085;402;}; "France";
"UNKNOWN")
Anonymous
6 years agoNot applicable
Anonymous Please place inverted comma at right place
I guess this is beacuse there is an inverted comma in Spain.
BU = SWITCH(TRUE();
SOMA[Branch Number] IN {030;042}; "Spain ";
SOMA[Branch Number] IN {031;034; 082;083;085;402;}; "France";
"UNKNOWN")
- Anonymous6 years agoNot applicable
AnonymousStill same. Please see a screeshot.
- Anonymous6 years agoNot applicable
Anonymous Please remove the semicolon after 402 value
BU = SWITCH(TRUE();SOMA[Branch Number] IN {030;042}; "Spain ";SOMA[Branch Number] IN {031;034; 082;083;085;402}; "France";"UNKNOWN")- Anonymous6 years agoNot applicable
AnonymousVery True!
Corrected but now I am getting different error ( and I have changed format- the Branch Number column is under text format).