Grouping in Pivot Query

LabKey Support Forum
Grouping in Pivot Query marcia hon  2018-03-07 10:20
Status: Closed
 
Hello,

I have a query, that requires a pivot. However, I am unable to get the group by to work appropriately. My query is:
...
'CYP1A2_rs762551'
)
AND D.LabID<100
GROUP BY D.SeriesName, D.LabID, D.CollaboratorSampleID, D.Sex, G.Locus, G.Allele1, G.Allele2

PIVOT Alleles BY Locus

ORDER BY SeriesName, LabID, CollaboratorSampleID, Sex

...


I would like Group by to work for : D.SeriesName, D.LabID, D.CollaboratorSampleID, D.Sex

Not to include Locus, and Allele1/2

I look forward for your insight.
 
 
Jon (LabKey DevOps) responded:  2018-03-09 16:17
Hi Marcia,

Have you taken the time to review our robust Support Documentation?

https://www.labkey.org/Documentation/wiki-page.view?name=default

Many of your questions can be answered in our docs and we even have videos to help you understand how to both use LabKey and understand the functionality:

https://www.labkey.org/Documentation/wiki-page.view?name=videos

For future, please do your best to consult our fantastic docs first before posting to the Community Forums.


Regarding your PIVOT query, have you reviewed our PIVOT documentation?

https://www.labkey.org/Documentation/wiki-page.view?name=pivot

The query you provided looks malformed and without knowing more details of the actual data, doing a PIVOT may not be possible depending on what is within those respective columns and the groupings.

Regards,

Jon