HI!
I've made a jsl script which is the following one :
For Each Row(
dt_fichier3,
// Lire la valeur de la colonne "Process" et les offsets
process_value = :Process;
first_offset = :first_OFFSET;
second_offset = :second_OFFSET;
third_offset = :third_OFFSET;
// Vérifier et assigner les valeurs des offsets si elles ne sont pas vides ou "."
If(
(Char(first_offset) != "." & Char(first_offset) != "") | (Char(second_offset) != "." &
Char(second_offset) != "") | (Char(third_offset) != "." & Char(third_offset) != ""),
// Créer une nouvelle colonne dans le fichier1 si elle n'existe pas encore
new_column_name = process_value || "_offset";
dt_fichier1 << New Column(new_column_name, Numeric, Continuous);
// Définir la formule pour la nouvelle colonne
Column(dt_fichier1, new_column_name) << Set Formula(
Eval(
Eval Expr(
If(:Supplier == "FIRST",
:Expr(process_value) + Expr(:first_OFFSET),
If(:Supplier == "SECOND",
:Expr(:Process) + Expr(:second_OFFSET),
If(
:Supplier == "THIRD",
:Expr(:Process) + Expr(:third_OFFSET),
,
:Expr(:Process) // Valeur par défaut si aucun fournisseur ne correspond
)
)
)
)
)
);
);
);
Edit (2024-08-08 jthi): Added jsl formatting
the problem is that the formula doesn't work because the column name appeart in the column info->Formula as "Column_name" or it should be "Column-name"n, I trid to use Name() function but it did not work