Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Player1005
Starting Member
4 Posts |
Posted - 2004-04-30 : 07:28:58
|
How can I avoid certain aggregations?I have a fact with:transactionID employeeID Flag Value1 w 0 1001 x 0 1001 y 0 1001 z 1 1002 x 0 2002 z 1 200How can I force that only the values where flag = 1 are aggregated?Thx for help!Pl1005 |
|
jsmith8858
Dr. Cross Join
7423 Posts |
Posted - 2004-04-30 : 09:11:26
|
SUM(CASE WHEN Flag=1 THEN Value ELSE 0 END) as Total- Jeff |
|
|
|
|
|