I want two seperate rollups of the data but I do not want to display every rollup. IE:
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
What is the query to create this output?
Are you using ROLLUP?
Then of course you could apply some filter in HAVING like
HAVING (Group1 in (1) or sales = 250)
the data above is base data. I do not have a query to return those results yet. The issue I am having is I am not able to filter on sales because the values will change. I have tried rollup and grouping set but have not been able to get my results above (1,2,3,4).