facing problem while trying to replace the null values in a particular column to “0”
Please help me regarding the issue
Thanks in advance
facing problem while trying to replace the null values in a particular column to “0”
Please help me regarding the issue
Thanks in advance
hi
yourstringvariable.ToString.Replace(“”,“0”)
hope this would help you
Cheers @AryanSingh
i am trying to replace all the null values with “0” in a column from the data table.
Fine in that case
–hope you have a datatable ready and lets name it outdt
–now use a for each row loop and pass that variable as input
–inside this use a if condition like this
String.IsNullOrEmpty(row(“yourcolumnname”).ToString)
if true goes to THEN part where use a assign activity like this
row(“yourcolumnname”) = “0”
Cheers @AryanSingh
Hi @AryanSingh
You can check whether the string is null using the below command in an IF activity
String.IsNullOrEmpty(YourStringVariable)
This will return true if the variable has a null. Within the Then segment of the IF activity, you can use an assign activity to assign the variable with the default “0”.
You also mentioned that you want to replace null values in a Column. Is this a data table?
Then you can do the following
IF String.IsNullOrEmpty(row(“ColumnName”).ToString)
If activity is the same as above
@Palaniyappan
@Lahiru.Fernando
Thanx… Let me try.
Will get back to u!
Sure
Cheers @AryanSingh
@Palaniyappan
@Lahiru.Fernando
Hi i have successfully done the replacement but now facing another issue
Input string was not in correct format.
Please help me with this.
Fine
how would be the value of BaseOutstanding column would be
can we have a sample - screenshot if possible
Cheers @AryanSingh
@Palaniyappan
@Lahiru.Fernando
Please check this. Column values after replacement are like this.
Has both negative and positive values. So need to add all the values.
Is there any necessity to convert them as double
— I hope the variable retvalue is of type Double
Cheers @AryanSingh
as u can see there are decimal values so need to add all the values…thats y i converted them to the double.
Please check this. spaces are present between the digits
Due to spaces. So tried using the “trim” command like given below:
But still facing the issue of format not correct
Fine
i hope the issue is due to - symbol before value and space between the values
let me check once
Cheers @AryanSingh
ok…so i should replace the “-” sign with the “”
Then subtract the them by using the assign activity, right?
yes exactly
Cheers @AryanSingh
Sure
Cheers @AryanSingh
Still facing the same issue when trying to replace the “-” sign
Please check it. Is my command correct?