cancel
Showing results for 
Search instead for 
Did you mean: 

Selecting a variable no. of Table Rows

Former Member
0 Kudos

Hi Friends,

I have a Table that is listing product details e.g NAME; PRICE; QUANTITY.

I want to select the row which has the 3rd lowest price. Now the Problem is that the 3rd(value) is not static but dynamic i.e. its variable and is known at runtime of the application and is specified by the user.

Is there any way of selecting or filtering out a specified row by means of 4the lowest or 3rd lowest value of column in a table.

I am trying it out for quiet some time but unfortunately with no success.

please help.

Best regards,

Farhan Shamim

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Well, I found a way to do this.

It's not the cleanest way, but it seems to work.

What I have done is as following:

Create a sorted copy of the table and make it invisible.

On the button that triggers the service (most commonly the "submit" button), add the following actions:

Delete the current line from the dummy table.

Delete (again) the current line from the dummy table.

Find the line on the real table where the price equals to the selected price in the dummy table.

What happens is that the first two rows of the dummy table are deleted. Then the third row becomes the current row. Now all you need to do is to select the line with the same value in the original table.

Here are some screen shots from my application. Note that I used age rather than price.

[The model|http://img147.imageshack.us/my.php?image=modeleo2.png]

[The action sequence|http://img387.imageshack.us/my.php?image=actionszm3.png]

[The find action|http://img233.imageshack.us/my.php?image=findactionly7.png]

This might not be the most elegant solution, but it seems to work.

Regards,

Shai

Former Member
0 Kudos

Hi Shai,

Thanks for the extra effort and uploading the images but i am not able to see them since they have been blocked by the Companys firewall

Well I believe your solution works but only if I always have to get the 3 highest or lowest Value respectively the row.

See the Problem is that the Value 3 should be dynamic i.e. the user specifies it at runtime and it can be 4 or 5 ...

Now keeping that in mind, is there any way to delete or filter out no. of rows based on a user specified value that you know perhaps?

I really appreciate your helping me out here.

Best Wishes,

Farhan Shamim

Answers (0)