Sum function doubling

  • I have a very strange problem that I am pulling my haiir out over (not much there to begin with).

    I am using SQL 2008 R2. Within SSAS, I have a calculated field within my DSV. I am trying to create a custom count field. Here is my calc ...

    CASE WHEN NEWY = 0 THEN 0 ELSE 1 END

    When exploring the data once I do this, everything looks right. I have verified that I do not have duplicate records. Basically, for every record where NEWY has a value I want to have my new field set to a value of 1. Within my cube, I sum this field.

    Problem is that this number is exactly doubled within my cube.

    The dsv view looks right. The cube is doubling value.

    Strange thing is that I have another field using a different condition that works perfectly (just using a different field).

    Hope this make a little sense ... any help would be greatly appreciated.

  • Well I guess I just need to post something here to change my luck. I found the problem. I am using Partitions within my cube and separate my partitions by year. I was including the same set of data in both my partitions. Once I added the much needed "WHERE" clause, everything worked as intended. The other calc that was working just so happened to be in a different measure group that had the proper selection clause specified.

    Thanks anyway ...

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply