Page 1 of 1

HT display the first record of each group ?

PostPosted: Thu Aug 18, 2005 11:34 am
by podelin
Hi !

I have record with these items:

Group_ID
Item_ID
Item_name
date_start
Status (To do , Done)

Group_ID Item_ID Item_name date_start

100 101 xxx the date
100 102 xxx the date + 1
100 103 xxx the date + 3
200 201 yyy the date
200 202 yyy the date + 4
200 203 yyy the date + 6
300 301 zzz the date

Can a portal, based on a self join, display *only the first record of each group*, ie:

100 101 xxx the date
200 201 yyy the date
300 301 zzz the date

Those records appears in the portal if the status task is defined "to do".

If impossible, another way or workaround ?

Thanks in advance

Best

Patrick

PostPosted: Sun Aug 21, 2005 6:39 am
by John Sindelar
One way to think of this is that you want to see one each of the group records- and for each, the first matching Item ID and Date from todo. To do this you wouldn't make a self join in todos, you'd go to a table occurrence from your Groups Table - showing one row for each record (group) - and from there show records from a relationship from Groups to todos.

One quick to this approach (one advantage?) is that it will show a row for each group even if there is no relevant todo for that group. This can be good in the "group 102" will always be on the second line, not sometimes on the first line if group 101 has not undone todos.

Of course, if you don't already have a table for Groups, you'll need to make one.

Hope that helps.

PostPosted: Mon Aug 22, 2005 12:46 am
by podelin
Thank you John !

I'll try this soon

Best

Patrick