Hi, I have this column named “Product Category” and “N.W” as shown below:
I need to add a new column called “NW Elasthane”.
Whenever, “Product Category” contains “… 95% ORGANIC COTTON 5% ELASTHANE” we do 5% of the N.W(0.05*N.W) and paste it in “NW Elasthane”
Whenever, “Product Category” contains “…92% ORGANIC COTTON 8% ELASTHANE” we do 8% of the N.W(0.08*N.W) and paste it in “NW Elasthane”
Whenever, “Product Category” contains “…100% ORGANIC COTTON” we paste 0 in “NW Elasthane”
AFTER:
Can someone help please?
Thanks!
UIPath_Excel_Scratch.xlsx (113.6 KB)
I am doing this:
But I am getting this error:
@prasath_S Can you help me on this one please mate?
prasath_S
(prasath S)
April 21, 2021, 7:57am
6
Hi @Yudhisteer_Chintaram1
Could you share the workflow and excel file so i can check from my end…thanks
Your N.W column contains Double Data Type values. Also sometimes this column is empty. So make sure you add assign activity under IF which checks column is not null.
Assuming N.W column is not Double:
row("NW Elasthane") = (CDbl(row("N.W")) * 0.05). ToString
Assuming N.W column is Double:
row("NW Elasthane") = (row("N.W") * 0.05). ToString
“IF which checks column is not null.”
What is going to be my condition in the IF statement?
Thanks!
Try row("N.W").ToString <> ""
If suppose you don’t check for empty column values, then NW Elasthane column value be 0.
Yes like this. For “100% ORGANIC COTTON”, you are going to assign NW Elasthane column 0. So here you don’t require If.
Instead of adding Switch inside If, try adding If inside “95% ORGANIC COTTON 5% ELASTHANE” & 92% ORGANIC COTTON 8% ELASTHANE” case.
I am really struggling @Shraddha_Gore .
Could please show me please?
Hi @Yudhisteer_Chintaram1 ,
Add_NW_Elasthane_Column.xaml (13.0 KB)
Here I’ve assigned Double Data Type to NW Elasthane column while adding it to Datatable. As a result, it assigns 0 to empty column values.
If you want blank NW Elasthane, then you’ll have to assign N.W Column String datatype.
And Implement If Else like this,
darshan.bp
(Darshan Bp)
April 21, 2021, 11:56am
17
U can find the solution in this workflow
Format_Excel_Column_NewData.xaml (6.6 KB)
Attached the Output file here @Yudhisteer_Chintaram1
UIPath_Excel_Scratch.xlsx (25.6 KB)
Welcome,
Please mark as a Solution @Yudhisteer_Chintaram1