Page 1 of 1

find data by row

Posted: December 21st, 2012, 1:27 pm
by khurshid.arshad
Dear Gregory Martin

I want to find data by row instead by column. For example:

I have 6 variables and 25 rows and now i want to find first value "<=10" in 25 rows but by row.


Regards.

arshad

Re: find data by row

Posted: December 22nd, 2012, 8:01 am
by khurshid.arshad
Dear Gregory

I am using Vertical (Column-oriented) and Free Movement (Horizontal) for Find Data by row.

Please Advise.

Arshad

Re: find data by row

Posted: December 24th, 2012, 1:35 pm
by Gregory Martin
Have you looked into the seek function? It will find data by occurrence number, which means that it will search for the first occurrence (row) that satisfies a given condition.

Re: find data by row

Posted: December 26th, 2012, 1:55 pm
by khurshid.arshad
Dear Gregory Martin

Basically we are using random sticker for individual selection from roster. For reference i am sending dummy excel file and cpro file.

Please see syntax. Is this fine or we can write in better way. The second thing is the error message is not working on second variable (V2) on 10th occurrence.

Regards and take care.

arshad

Re: find data by row

Posted: December 27th, 2012, 12:13 pm
by Gregory Martin
The error message is not working for you because when you use Free Movement mode, all logic is turned off. This is because Free Movement mode is designed to allow a keyer to enter data without worrying about the order of entering the data. Thus, the concept of checks and actions does not necessarily make sense. You can put your logic checks in the postproc of the roster.

Unfortunately, your PROC QID logic is your best option if you want to use Free Movement mode. If you don't mind separating your rows into separate rosters, you can use subitems to make the logic easier. See attached for an example.
PROC QID2

    
Numeric FindIndex;

    FindIndex =
Seek(Q<=$);

    
If FindIndex > 0 then
        
Errmsg("Data found in row #%d, value is %D",int(( FindIndex + 9 ) / 10),Q(FindIndex));
    
endif;

Re: find data by row

Posted: December 29th, 2012, 11:39 am
by khurshid.arshad
thanks.
arshad