Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Yevhenii_Senko
Contributor III
Contributor III

Many to one relationship

Hi,

Need help, this is urgent!

I have to tables.

Have to be relationship between them.

Code1 - AllCodes

Code2 - AllCodes

Code3 - AllCodes

After update if select Amigo will be showed "Store1" according to Code1.

If select "Mall" will be showed Store1 and Store2 according to Code1 and Code3.

Codes: 

Code1Code2Code3Store
112233Store1
W4S2V7Store2

Info:

AllCodesTypeSquareName
11Street100Amigo
W4Mall200Jump
33Mall300Free

Thanks in advance!

11 Replies
johnw
Champion III
Champion III

Yes. If store is not a unique key, you'd probably want to use whatever the unique key to the table actually is. Hard to say, as it throws some of my basic assumptions about your data out the window. What IS the key to your table? What does your data ACTUALLY look like?

Yevhenii_Senko
Contributor III
Contributor III
Author

That table doesn't have key field.

I found one way to solve it.

Put RowNo() in both tables.

Is it correct mothod?

StoreData:
LOAD

RowNo()
,Store
,SalesQty
,Margin
,etc
FROM your codes data source
;
StoreCodes:
CROSSTABLE (Codenum,AllCodes)
LOAD

RowNo()

,Store
,Code1
,Code2
,Code3
FROM your codes data source
;
Info:
LOAD
AllCodes
,Type
,Square
,Name
FROM your info data source
;