Hi:
I agree with Art. I don't understand how your posted results correspond to what you said about wanting "to produce a table with
all combinations of the characteristic X contained in the material".
I'm confused about a few things:
1) Right now, in the data, you only show the same value for object A (first col) -- does your data have more than one object A?? I would normally expect that your data was more than 6 rows or observations. What is the logical connection between your object A and your object B and characteristic X. For example, all the values of object A are the same, but you have 2 unique values for object B. Considering ONLY object A, you have 6 values for characteristic X -- but only 5 unique values.
2) You say you have to produce this table with all combinations of X (last column) for every unique value of A -- will you ever have to produce this set of combinations across the whole table or will it always be across unique values of A?? Where do the other columns come into play???
You have 6 values for the last column (characteristic X) for unique values of object A=235456 :
[pre]
PO
UI
UR
PO
AL
KO
[/pre]
(of course PO is repeated twice...you'll have to decide how to deal with that)
ALL the possible combinations would be something like this:
[pre]
PO combined with all:
PO PO
UI PO
UR PO
PO PO
AL PO
KO PO
UI combined with all:
PO UI
UI UI
UR UI
PO UI
AL UI
KO UI
UR Combined with all:
PO UR
UI UR
UR UR
PO UR
AL UR
KO UR
The second value of PO combined with all:
PO PO
UI PO
UR PO
PO PO
AL PO
KO PO
AL combined with all:
PO AL
UI AL
UR AL
PO AL
AL AL
KO AL
KO combined with all:
PO KO
UI KO
UR KO
PO KO
AL KO
KO KO
[/pre]
Is there some other criteria for the combinations you envision?? Is KO-AL the same as AL-KO as a combination, for example??? What about the fact that PO occurs twice for object A -- should it only get considered 1 time???
If you only considered the unique combinations, then you might get combinations like this (PO only counted one time):
[pre]
PO combined with all:
PO PO
UI PO
UR PO
AL PO
KO PO
UI combined with everything but PO:
UI UI
UR UI
AL UI
KO UI
UR combined with everything but PO and UI:
UR UR
AL UR
KO UR
AL combined with everything but PO, UI and UR:
AL AL
KO AL
KO combined with itself:
KO KO
[/pre]
Or is there some other combination that you envision??? The first combination example sounds like a Cartesian product to me.
http://support.sas.com/kb/25/270.html
And, this paper has some other examples of SQL joins:
http://support.sas.com/resources/papers/proceedings09/062-2009.pdf
The second combination sounds like a specialized join or a Cartesian product with some post-processing to remove duplicates. Right now, I don't understand where your second column (object B) or your third column (X) or your 4th column (M) come into play in the combinations you want.
cynthia