Showing posts with label case. Show all posts
Showing posts with label case. Show all posts

Sunday, March 25, 2012

Calculated measure based on field in fact table that is not a measure in cube.

I have several fields in the fact table that are not measures in a cube. In this case I have a OrderEntryDateId, WantDateId, and InvoicedDateId. If the order has not invoiced the InvoiceDateId is 0 (zero).

My cube joins the fact table to the time dimension table on the wantDateId. The cube has measures for feet, dollars, pounds, material cost...

I want to create a calculated measure called "Invoiced Dollars" that is based on iff(invoiceDateId>0;TotalDollars,0) however invoiceDateId is not a measure nor is it linked to time in this cube.

Any ideas?

Hi. You could make the InvoiceDateID a member property of time dimension at the leaf level. You can then check the member property value in your calulated member. It might look something like this:

IIF(CINT(Time.Time.CurrentMember.Properties("InvoiceDateID")) > 0, TotalDollars, 0)

Drawbacks to this solution: (1) it only works at the leaf level of the time dimension, (2) Probably slow because of the conversion of the member property value.

Hope this helps - Paul Goldy

|||

I already played with this a bit this afternoon and it is not what I need.

I guess the best way to do this is to add a column to the fact table so it can work at all levels and be pre-aggregated.

Thanks!

Friday, February 10, 2012

Bunch Of 5 Rows

Hi All,
I have a case in which i have to get the bunch of 5 rows at a time
from database, It could be taken in stored procedure also.
i would like to tell you how should i get results. I
have total 40 rows in my table, if i execute Stored procedure first time, i
should get first 5 rows, second time i should get second 5 rows so and so
for. This way i have to execute this stored procedure 8 times sothat i could
get all 40 rows.
If anybody have solution, plz
help mehttp://www.aspfaq.com/show.asp?id=2120
David Portas
SQL Server MVP
--|||Hi David
I got to know that this is asp code, i want it to all this work
in SQL server only, can @.@.cursor_rows help me?
"David Portas" wrote:

> http://www.aspfaq.com/show.asp?id=2120
> --
> David Portas
> SQL Server MVP
> --
>|||Why would you use a cursor? The ASPFAQ article proposes several
solutions - none of them requires a server-side cursor.
David Portas
SQL Server MVP
--|||On Thu, 11 Aug 2005 22:01:02 -0700, Manish wrote:
>Hi David
> I got to know that this is asp code, i want it to all this work
>in SQL server only, can @.@.cursor_rows help me?
>"David Portas" wrote:
>
Hi Manish,
Visit that URL again. The first few solutions are ASP, but further down
are some SQL Server ways.
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)