Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sum a Case Statement

Status
Not open for further replies.
Jul 19, 2003
132
NZ
I'm trying to Sum a conditional count in Analysis Services.

This is how I'd do it in SQL;

Sum(case when dbo.Dim_TaskResult.SpeciesName is not null
and dbo.Dim_TaskResult.SpeciesName <>'Unknown'
then 1 else 0 end) as Measure.

I've created a Named Calculation in the dsv;
case when dbo.Dim_TaskResult.SpeciesName is not null
and dbo.Dim_TaskResult.SpeciesName <>'Unknown'
then 1 else 0 end

I've then created a Measure in the cube that Sums this Named Calculation.

When I put it in my report every value of a dimension selected has the same total.

Thanks

Bruce

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top