Hi everyone,
Tryng to evaluate if item(s) from a EnumLIst column is(are) present and the return a value depending on the item(s) selected from the EnumList.
Using this formula, the problem is that the evaluation stop at first-match how is supposed. [Variations] is the EnumList column.
IFS(
IN("Cuello V",[Variations]),V,
IN("Bolsillo",[Variations]),B,
IN("Manga larga",[Variations]),ML,
IN("Niรฑos",[Variations]),K,
IN("Con Botones",[Variations]),CB,
IN("Cierre Magico",[Variations]),CM
)
Thanks
Solved! Go to Solution.
So it is not a matter of precedence of one style code over another, rather, you have dedicated codes for combined styles like Manga Larga and Cuello V.
Using IFS(), you should put your combined styles before the corresponding individual ones and adapt the expression accordingly. Like this:
IFS(
AND(
IN("Cuello V", [Variations]),
IN("Manga larga", [Variations])
), "111-MLV",
IN("Cuello V",[Variations]),V,
IN("Manga larga",[Variations]),ML,
|
|
TRUE, "Unknown model"
)
PS: tell me should you get stuck with the other solution.
CONCATENATE(
IFS(IN("Cuello V",[Variations]),"V"),
IFS(IN("Bolsillo",[Variations]),"B"),
IFS(IN("Manga larga",[Variations]),"ML"),
IFS(IN("Niรฑos",[Variations]),"K"),
IFS(IN("Con Botones",[Variations]),"CB"),
IFS(IN("Cierre Magico",[Variations]),"CM")
)
Hola,
And why would you want to do that? Away from the expression, what is your own logic in plain language? It is better to explain what you want to do and the solution can be different using IFS() or other functions.
For example, if you have a shirt with Cuello V and at the same time with Manga Larga, and in this case you want the result to be "ML" instead of "V", then you should move your Manga Larga line before Cuello V in your IFS() expression.
If you want to base the decision on exact matches of different values, then you might need to use SWITCH() instead.
So, please first write your logic as you'd describe it to a human coworker. Thanks.
Hola Joseph!
The idea is to generate an StyleID based on the options selected in [Variations] column (EnumLIst):
111-MLV meaning style is Manga Larga y Cuello V.
There a 6 variations that all can be selected or not and any combinations between them.
Gracias!
PS: Still working on the solution that you recommend it me on a different post.
So it is not a matter of precedence of one style code over another, rather, you have dedicated codes for combined styles like Manga Larga and Cuello V.
Using IFS(), you should put your combined styles before the corresponding individual ones and adapt the expression accordingly. Like this:
IFS(
AND(
IN("Cuello V", [Variations]),
IN("Manga larga", [Variations])
), "111-MLV",
IN("Cuello V",[Variations]),V,
IN("Manga larga",[Variations]),ML,
|
|
TRUE, "Unknown model"
)
PS: tell me should you get stuck with the other solution.
CONCATENATE(
IFS(IN("Cuello V",[Variations]),"V"),
IFS(IN("Bolsillo",[Variations]),"B"),
IFS(IN("Manga larga",[Variations]),"ML"),
IFS(IN("Niรฑos",[Variations]),"K"),
IFS(IN("Con Botones",[Variations]),"CB"),
IFS(IN("Cierre Magico",[Variations]),"CM")
)
@Steve Here comes our master ๐ Very clever!
Thank you guys.
User | Count |
---|---|
43 | |
26 | |
23 | |
14 | |
12 |