Quantcast
Channel: Teradata Forums - All forums
Viewing all articles
Browse latest Browse all 27759

How can I avoid using a Union statement here? - forum topic by dsldsl1980

$
0
0

I want two seperate rollups of the data but I do not want to display every rollup.  IE:
Data:
Group1    Group2    Sales
1              2             $100
1              3             $50
1              3             $50
1              1             $50
2              1             $25
 
1. I want to see all summed values of groups (1,2),(1,3),(2,1)
2. I want to see sum of Group 1 only when it is = 1 or $250
3. I want to see sum of group 2 when it is in (1,2) or $175
4. I do not want to see 2 lines displaying $25 for the group 2 rollup

Forums: 

Viewing all articles
Browse latest Browse all 27759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>