Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Question how to calculate formula in the data sheet
#1
Solved: 10 Years, 9 Months, 1 Week 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: 10 Years, 9 Months, 1 Week 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: 10 Years, 9 Months, 1 Week 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 8,900 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,715 01-17-2017, 04:05 PM
Last Post: sagar.raythatha
Question QTP not performing iterations based on local data sheet Breaker 18 55,327 01-25-2016, 04:32 PM
Last Post: arunshuklainbox
  Importing data sheet Santu 2 3,207 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,050 06-02-2015, 09:19 PM
Last Post: M Adnan Iftikhar

Forum Jump:


Users browsing this thread: 1 Guest(s)