find data by row

Discussions about CSEntry
Post Reply
khurshid.arshad
Posts: 423
Joined: July 9th, 2012, 11:32 am
Location: Islamabad, Pakistan

find data by row

Post by khurshid.arshad » December 21st, 2012, 1:27 pm

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

khurshid.arshad
Posts: 423
Joined: July 9th, 2012, 11:32 am
Location: Islamabad, Pakistan

Re: find data by row

Post by khurshid.arshad » December 22nd, 2012, 8:01 am

Dear Gregory

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

Please Advise.

Arshad

Gregory Martin
Posts: 1338
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: find data by row

Post by Gregory Martin » December 24th, 2012, 1:35 pm

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.

khurshid.arshad
Posts: 423
Joined: July 9th, 2012, 11:32 am
Location: Islamabad, Pakistan

Re: find data by row

Post by khurshid.arshad » December 26th, 2012, 1:55 pm

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
Attachments
Test.rar
CPro file
(5.72 KiB) Downloaded 263 times
sticker.xlsx
Excel file
(8.84 KiB) Downloaded 257 times

Gregory Martin
Posts: 1338
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: find data by row

Post by Gregory Martin » December 27th, 2012, 12:13 pm

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;
Attachments
Test.zip
(2.86 KiB) Downloaded 244 times

khurshid.arshad
Posts: 423
Joined: July 9th, 2012, 11:32 am
Location: Islamabad, Pakistan

Re: find data by row

Post by khurshid.arshad » December 29th, 2012, 11:39 am

thanks.
arshad

Post Reply