find data by row

Discussions about CSEntry
Forum rules
New release: CSPro 8.0
Post Reply
khurshid.arshad
Posts: 571
Joined: July 9th, 2012, 11:32 am
Location: Islamabad, Pakistan

find data by row

Post 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
khurshid.arshad
Posts: 571
Joined: July 9th, 2012, 11:32 am
Location: Islamabad, Pakistan

Re: find data by row

Post by khurshid.arshad »

Dear Gregory

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

Please Advise.

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

Re: find data by row

Post 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.
khurshid.arshad
Posts: 571
Joined: July 9th, 2012, 11:32 am
Location: Islamabad, Pakistan

Re: find data by row

Post 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
Attachments
Test.rar
CPro file
(5.72 KiB) Downloaded 404 times
sticker.xlsx
Excel file
(8.84 KiB) Downloaded 391 times
Gregory Martin
Posts: 1777
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: find data by row

Post 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;
Attachments
Test.zip
(2.86 KiB) Downloaded 405 times
khurshid.arshad
Posts: 571
Joined: July 9th, 2012, 11:32 am
Location: Islamabad, Pakistan

Re: find data by row

Post by khurshid.arshad »

thanks.
arshad
Post Reply