I've spent over a day playing with this on paper...
In the SQL world, I think this is feasible with some convoluted joins, unions, select ins, select distincts, etc. But can someone explain how I might achieve my goal in this WAS application?
Table looks fundamentally like this: (if preferable, this could be structured as a view, with linking tables - but I fared no better with that approach)
(3 fields)
x y z <--- column names
1 A !
1 A #
1 B !
2 A $
3 B %
4 C #
4 D #
5 E $
6 C #
I wish to display a grid containing only DISTINCT column y filtered primarily on column z. The actual arguments available to the select/filter process are both x and z. All distinct y for any submitted z should be displayed, however, a special display attribute should indicate where there is also a match on x. Therefore, a match on x is optional, but where there is a match, it must be somehow reflected in the display. (Each displayed y will be a link to a detail view of y.) A few examples:
GenerateGrid(x=1, z="#")
desired result:
**A** (asterisks, or some other visual attribute indicating a match on x)
C (notice C is displayed only once, though it matches on both x=4 and x=6)
D
GenerateGrid(x=1, z="$")
desired result: (no match on x, so no special attribute)
A
E
GenerateGrid(x=5, z="$")
desired result:
A
**E**
The first/biggest problem I've run in to is display of duplicate matches (as in first example). While there's an option for Unique Records Only, it seems inapplicable due to apparent necessity of including other columns in the filter/view.
Or is this best solved via xbasic code? Any hints on how to implement that?
[edit: I'm using standard .dbf for this; maybe an SQL db is the "no-brainer" answer?]
In the SQL world, I think this is feasible with some convoluted joins, unions, select ins, select distincts, etc. But can someone explain how I might achieve my goal in this WAS application?
Table looks fundamentally like this: (if preferable, this could be structured as a view, with linking tables - but I fared no better with that approach)
(3 fields)
x y z <--- column names
1 A !
1 A #
1 B !
2 A $
3 B %
4 C #
4 D #
5 E $
6 C #
I wish to display a grid containing only DISTINCT column y filtered primarily on column z. The actual arguments available to the select/filter process are both x and z. All distinct y for any submitted z should be displayed, however, a special display attribute should indicate where there is also a match on x. Therefore, a match on x is optional, but where there is a match, it must be somehow reflected in the display. (Each displayed y will be a link to a detail view of y.) A few examples:
GenerateGrid(x=1, z="#")
desired result:
**A** (asterisks, or some other visual attribute indicating a match on x)
C (notice C is displayed only once, though it matches on both x=4 and x=6)
D
GenerateGrid(x=1, z="$")
desired result: (no match on x, so no special attribute)
A
E
GenerateGrid(x=5, z="$")
desired result:
A
**E**
The first/biggest problem I've run in to is display of duplicate matches (as in first example). While there's an option for Unique Records Only, it seems inapplicable due to apparent necessity of including other columns in the filter/view.
Or is this best solved via xbasic code? Any hints on how to implement that?
[edit: I'm using standard .dbf for this; maybe an SQL db is the "no-brainer" answer?]
Comment