Joining tables based on Subject Id and Visits/Sequence

LabKey Support Forum (Inactive)
Joining tables based on Subject Id and Visits/Sequence Edward  2018-09-21 01:44
Status: Closed
 
Hi Jon,

Thanks for replying. I am trying to create gridview by joining columns from two different datasets.

In these datasets, one has few columns while the other one has upto 150 columns. I noticed that in these 150 columns a set of 15 columns are repeating and so I thought it would be best to transpose the repeating columns into rows, which will significantly reduce the number of columns but it will also mean to have duplicated values for Visits. Due to this I made visits sequence (such that visit 1 = 1.00-1.99, 2 = 2.00-2.99 etc.).

As an example consider the attached screenshot S1 where I have joined the transposed dataset on another dataset. If you can see I get Name, age and sex columns empty because the database is doing join based on Visit_Sequence and id, even if Visit_Sequence values belong to the same visit. Ideally, I would like to get a resulting table similar to the attached screenshot S2.

Your help is highly appreciated. Thanks!