- Home
- Anonymous
- Sign in
- Create
- Ask a question
- Spaces
- Site Issues (NOT FOR DATABASE QUESTIONS)
- Explore
- Topics
- Questions
- Users
- Badges

I have a table T with four dimensions and one measure like this: Dim1, Dim2, Dim3, Dim4, Msr 1A, 2A, 3A, 4A, 100 1A, 2A, 3A, 4B, 50 1A, 2A, 3B, 4A, 75 1A, 2A, 3B, 4B, 25 I would like to inject a new measure (Msr_new) that sums (Msr) ONLY FOR unique combinations of Dim1 through 3 (not Dim4), such that result set like Dim1, Dim2, Dim3, Dim4, Msr, Msr_new 1A, 2A, 3A, 4A, 100, 150 1A, 2A, 3A, 4B, 50, 150 1A, 2A, 3B, 4A, 75, 100 1A, 2A, 3B, 4B, 25, 100 I tried SELECT Dim1...Msr, SELECT Sum(Msr) FROM T AS SubT GROUP BY SubT.Dim1,...SutT.Dim3 with no luck. Any help much appreciated.

subquery
Comment

**17** People are following this question.

Copyright 2019 Redgate Software.
Privacy Policy