Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Question how to calculate formula in the data sheet
#1
Solved: 11 Years, 3 Months, 4 Weeks ago
Hi,

the formula in the in the "A" cell is, for example: 9+3

The command
print DataTable("A", dtGlobalSheet)
gives me the literal entry, '9+3'

How can I get the value of the formula, thus 12?

Thanks in advance.
Reply
#2
Solved: 11 Years, 3 Months, 4 Weeks ago
You have to put "=9+3" in the table cell just like Excel. The cell will display "12" unless the cell is being edited, in which case you will see the formula "=9+3". Summing values of other cells in the data table works the same way using Excel formulas. "=SUM(B1:B3)" will give you the sum of those three cells (B1, B2, and B3). Hope this helps.
Reply
#3
Solved: 11 Years, 3 Months, 4 Weeks ago
Thanks for your answer.

But what I meant was just the eval function.

print eval(DataTable("A", dtGlobalSheet))

returns 12 ... Cool
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Reading data from excel sheet serenediva 1 9,597 03-03-2017, 10:07 AM
Last Post: vinod123
  How import final calculated values by cell formula from Excel not the formula itself. qtped 1 4,851 01-17-2017, 04:05 PM
Last Post: sagar.raythatha
Question QTP not performing iterations based on local data sheet Breaker 18 56,683 01-25-2016, 04:32 PM
Last Post: arunshuklainbox
  Importing data sheet Santu 2 3,377 08-20-2015, 11:37 PM
Last Post: ADITI1992
  On Saving Script in QTP 11 my Global Data Sheet data is removed M Adnan Iftikhar 0 2,173 06-02-2015, 09:19 PM
Last Post: M Adnan Iftikhar

Forum Jump:


Users browsing this thread: 1 Guest(s)