Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Way to take values from datasheet and output
#1
Not Solved
Hi,

I would like to take the data from 2 columns in my datasheet and group them in groups of 17. So take the values from rows 1 to 17 from column A and B and write them out to the screen. Then do the same thing from row 18 to 34, etc etc until the last group has less than 17 (meaning its the end of the rows in the sheet).

Thinking of doing a loop and some sort of step 17 until i reach the count but not sure exactly how to go about it.

Thanks!
Reply
#2
Not Solved
I am not sure what is your 'Use Case' but here is what can be done -

  1. Count the total no of active rows in your data sheet.
  2. Divide it by 17 to get the (total no of groups -1)
  3. Mod it by 17 to get remaining no of rows.
  4. Store 2) and 3) above in an array as you wish.
Want to fast track your QTP/UFT Learning? Join our UFT Training Course
Reply
#3
Not Solved
Thanks for the quick reply!

I am pretty new to QTP, vbscript, and coding in general. What do you mean by Mod?

Basically im automating the payment of accounts. There is a script im piggybacking off that takes an account and quotes it, checks to make sure the amount is correct and then goes to the next account. What im trying to do is then take that account number and the $ amount and throw it onto a terminal screen. So account number will be in one column on the screen, each account number on its own line(17 lines total). 2 columns over i will have to have the corresponding $ amount for the account.
Reply
#4
Not Solved
mod operator gives you the remainder. This is standard across scripting/programming languages. Nothing too fancy. I am sure you will get a hang of such operators quickly as you start working on them.

You can try with
Code:
msgbox 19 mod 5
on QTP to get the idea.
Want to fast track your QTP/UFT Learning? Join our UFT Training Course
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Storing runtime value into datasheet priyaUFTlearner 4 3,426 04-10-2015, 10:08 PM
Last Post: priyaUFTlearner
  Error with QTP DataSheet Values. srach84 1 2,129 11-27-2014, 10:32 AM
Last Post: vinod123
  Output Values error Tasleem 3 3,926 10-27-2014, 02:13 PM
Last Post: Tasleem786
  Import and read multiple tabs on a datasheet trance07 1 3,378 10-09-2013, 07:29 PM
Last Post: Parke
  Sometimes there is Global datasheet. utestqa 0 2,712 10-02-2013, 07:09 PM
Last Post: utestqa

Forum Jump:


Users browsing this thread: 1 Guest(s)