Forum Discussion
Mic1979
2 years agoPost Partisan
Replacing values in two columns simultaneously under condition
Dear all, Up to now I have replaced values in one column based on a condition. Now I am trying to replace the values in two columns simulaneously vie the following function: let RULE_8 = (I...
- 2 years ago
Hey Mic1979 , try and let me know if there is any problem.
let RULE_8 = (Input_Table as table, Product_Series_Description as text) => Table.TransformColumns( Input_Table, { {"Body_Material", each if [Product_Series_Description] = "2 way Angle Body Valve" and ([Body_Material] = "Bronze" or [Body_Material] = "StSt 316L") and ([Stuffing_Box_Material] = "StSt 431" or [Stuffing_Box_Material] = "StSt 316L") then "StSt 316L" else _}, {"Stuffing_Box_Material", each if [Product_Series_Description] = "2 way Angle Body Valve" and ([Body_Material] = "Bronze" or [Body_Material] = "StSt 316L") and ([Stuffing_Box_Material] = "StSt 431" or [Stuffing_Box_Material] = "StSt 316L") then "StSt 431" else _} } ) in RULE_8
ahadkarimi
2 years agoSolution Specialist
Hey Mic1979 , try and let me know if there is any problem.
let
RULE_8 = (Input_Table as table, Product_Series_Description as text) =>
Table.TransformColumns(
Input_Table,
{
{"Body_Material", each if [Product_Series_Description] = "2 way Angle Body Valve" and
([Body_Material] = "Bronze" or [Body_Material] = "StSt 316L") and
([Stuffing_Box_Material] = "StSt 431" or [Stuffing_Box_Material] = "StSt 316L")
then "StSt 316L" else _},
{"Stuffing_Box_Material", each if [Product_Series_Description] = "2 way Angle Body Valve" and
([Body_Material] = "Bronze" or [Body_Material] = "StSt 316L") and
([Stuffing_Box_Material] = "StSt 431" or [Stuffing_Box_Material] = "StSt 316L")
then "StSt 431" else _}
}
)
in
RULE_8
Mic1979
2 years agoPost Partisan
Hei ahadkarimi,
thanks for this, but it is not working. in the columns I suppose to change I have Erros.
- ahadkarimi2 years agoSolution Specialist
Mic1979 can you please share a screenshot of the error?