hi there..
i have imported some data to globalsheet..
now i want to subtract the data A1-A2(the data is in numbers)and see A3=A1-A2 or not..
please help me in this regard..
thanks
chandu
Printable View
hi there..
i have imported some data to globalsheet..
now i want to subtract the data A1-A2(the data is in numbers)and see A3=A1-A2 or not..
please help me in this regard..
thanks
chandu
Hi Chandu,
Lets assume there are three columns in your global sheet
A1:- the first number.
A2:-the second number
A3:- the correct result which you know is correct.
try the code below:
'import the data from data table
dtA1 = DataTable.Value("A1",dtGlobalSheet)
dtA2 = DataTable.Value("A2",dtGlobalSheet)
dtA3 = DataTable.Value("A3",dtGlobalSheet)
var_sub = dtA1 - dtA2
var_data= CDbl(dtA3)
var_data1= CDbl(var_sub)
If var_data1 = var_data Then
Reporter.ReportEvent micPass, "The result is correct", "The result is correct"
Else
Reporter.ReportEvent micFail, "The result is incorrect", "The result is incorrect"
End If
--------------------
Let me now incase u have doubts in this.
Regards,
Tina Mahajan.
Global Sheet has an Issue i.e the number of entries implies that number of Run.
If the Data is in the Local Sheet then its pretty much simple. You need a loop for the entries..
DataTable.SetCurrentRow(1)
While Datatable.Value("A1",dtglobalsheet) <> ""
Datatable.Value("A3",dtglobalsheet) = Datatable.Value("A1",dtglobalsheet) - Datatable.Value("A2",dtglobalsheet)
DataTable.SetNextRow
Wend
Regards,
Nawab
[QUOTE=NawabShaikh;28565][B]Global Sheet has an Issue i.e the number of entries implies that number of Run.[/B]
If the Data is in the Local Sheet then its pretty much simple. You need a loop for the entries..
DataTable.SetCurrentRow(1)
While Datatable.Value("A1",dtglobalsheet) <> ""
Datatable.Value("A3",dtglobalsheet) = Datatable.Value("A1",dtglobalsheet) - Datatable.Value("A2",dtglobalsheet)
DataTable.SetNextRow
Wend
Regards,
Nawab[/QUOTE]
[B]Hi, I think this is the case with local sheet also. Am i wrong? Because i feel it when running my script.[/B]
I would not confront on the issue, but we had a comfort-level while using LocalSheet on Test Scenario....I will revert with a sourceCode/video file if possible...similar contribution expected by other members :)
Regards,
Nawab