Hi,
I have an excel sheet with multiple columns. I have to perform a check to compare the numeric value from column “CTC” with 0.5. If the value found to be <0.5, I have to delete the row.
I tried to perform " int32.Parse(row(“CTC”).ToString) < 0.5 " in if condition, but gives error as : Input string was not in a correct format. Please provide me the solution on this.
Regards,
Komal
arivu96
(Arivazhagan A)
February 19, 2018, 10:02am
2
Hi @Komal_Joshi ,
Try this
Convert.ToDecimal(row("CTC").ToString())<0.5
Regards,
Arivu
Thank you for your response. I tried with this but still it is giving me the same error.
arivu96
(Arivazhagan A)
February 19, 2018, 10:05am
4
Hi @Komal_Joshi ,
arivu96:
row(“CTC”).ToString()
Try to put log message and check what value are you getting.
Regards,
Arivu
ok Thanks. It doesn’t display the decimal values but does give out the same error.
arivu96
(Arivazhagan A)
February 19, 2018, 10:27am
6
Hi @Komal_Joshi ,
Try this code
Convert.ToDecimal(Convert.Tostring(row("CTC")))<0.5
Regards,
Arivu
Hi. Thanks. Still the same error and Exception type: Format Exception
arivu96
(Arivazhagan A)
February 19, 2018, 10:43am
8
Hi @Komal_Joshi ,
Try this
Decimal.TryParse(Convert.Tostring(row("CTC")),0)<0.5
Regards,
Arivu
Thanks.
It is not allowing the condition, gives the compiler error as :
Even if I put it in If box as an independent condition and not storing in a Boolean variable, it still says the same.
arivu96
(Arivazhagan A)
February 19, 2018, 10:49am
10
You asked if condition but you are assuming value??? Can you elaborate it,
Komal_Joshi
(Komal Joshi)
February 19, 2018, 10:52am
11
Well, I have multiple conditions to pass so I have stored those as values in boolean variables and have OR ed them in ‘If’ box. I need a condition to give.
arivu96
(Arivazhagan A)
February 19, 2018, 10:53am
12
Use it in if condition then store the result in Boolean variable.
Regards,
Arivu
Komal_Joshi
(Komal Joshi)
February 19, 2018, 10:55am
13
Yeah. Thanks. I did that too. but is giving me the same error. Please check.
arivu96
(Arivazhagan A)
February 19, 2018, 11:23am
14
Sorry now i got it what is the issue.@komal_Joshi
use below code
Convert.ToDecimal(iif(String.IsNullOrEmpty(row("CTC")),"0",row("CTC").ToString()))<0.5
Regards,
Arivu
Komal_Joshi
(Komal Joshi)
February 19, 2018, 11:32am
15
Hi @arivu96 , Thank you for your inputs. But it is giving the error:
arivu96
(Arivazhagan A)
February 19, 2018, 11:33am
16
@Komal_Joshi i think you missed IIF
Komal_Joshi
(Komal Joshi)
February 19, 2018, 11:34am
17
ok. Yeah. Sorry. Tried again but gives error:
arivu96
(Arivazhagan A)
February 19, 2018, 11:40am
18
Sorry I missed it
Convert.ToDecimal(iif(String.IsNullOrEmpty(Convert.ToString(row("CTC"))),"0",Convert.ToString(row("CTC"))))<0.5
Komal_Joshi
(Komal Joshi)
February 19, 2018, 12:12pm
19
OK. Thanks.
It’s giving the earlier error after execution as - Assign : Input string was not in a correct format.
arivu96
(Arivazhagan A)
February 19, 2018, 12:20pm
20
@Komal_Joshi can you send the xaml file for better understanding
Komal_Joshi:
execution as - Assign
for me its working, in if condition give the condition
Regards,
Arivu