Showing posts with label price. Show all posts
Showing posts with label price. Show all posts

Thursday, March 29, 2012

Count of Units * Unit Price

My dsv has two tables (one is used materials another is material price).

My used material dimension has "stock nr" and "count of material" attributes and material price table has "stock nr" and "unit price" attributes.

My goal is to calculate "total price" measure for the cube with count of material * unit price. Not all the materials have price value...

I don't know what to do. Could you recommend something?

- Using integration services instead of analysis service before processing.
- Using an MDX query (I am not good at MDX)
- Using Calculations?

Please help me in detail?

You could also join the 2 tables in the DSV, within a Named Query which returns total price as a computed column, like:

select u.[stock nr], p.[unit price], u.[count of material] * p.[unit price] as [total price]

from [used material] u

join [material price] p

on u.[stock nr] = p.[stock nr]

|||too late but thanks. I've used it

Count of Units * Unit Price

My dsv has two tables (one is used materials another is material price).

My used material dimension has "stock nr" and "count of material" attributes and material price table has "stock nr" and "unit price" attributes.

My goal is to calculate "total price" measure for the cube with count of material * unit price. Not all the materials have price value...

I don't know what to do. Could you recommend something?

- Using integration services instead of analysis service before processing.
- Using an MDX query (I am not good at MDX)
- Using Calculations?

Please help me in detail?

You could also join the 2 tables in the DSV, within a Named Query which returns total price as a computed column, like:

select u.[stock nr], p.[unit price], u.[count of material] * p.[unit price] as [total price]

from [used material] u

join [material price] p

on u.[stock nr] = p.[stock nr]

|||too late but thanks. I've used it

Tuesday, February 14, 2012

Corrupted view

Some days ago I created a view on a sqlserver database, that returns the
price and some other infos of invoice items. everything worked fine.
Now, the view didn't return the same as when I created it. The price
column of the returned record set showed the invoice date instead of the
price and some other columns also contained wrong information.
After recreating the view everything was fine again.
How can this happen?
Cheers
FerdinandFerdinand,
Did someone change the underlying table definitions? If so, run
sp_refreshview 'viewname' to get the view resynchronized with the underlying
tables.
RLF
"Ferdinand Zaubzer" <ferdinand.zaubzer@.schendl.at> wrote in message
news:OkORyxYuHHA.4540@.TK2MSFTNGP05.phx.gbl...
> Some days ago I created a view on a sqlserver database, that returns the
> price and some other infos of invoice items. everything worked fine.
> Now, the view didn't return the same as when I created it. The price
> column of the returned record set showed the invoice date instead of the
> price and some other columns also contained wrong information.
> After recreating the view everything was fine again.
> How can this happen?
> Cheers
> Ferdinand|||The explanation was given by Russell.
I strongly suggest you remove any * from the selection list in the
view's definition. Apart from the side effects in the view when adding
columns to the specific table, it is considered a bad practice to use
SELECT * in views in production code.
Gert-Jan
Ferdinand Zaubzer wrote:
> Some days ago I created a view on a sqlserver database, that returns the
> price and some other infos of invoice items. everything worked fine.
> Now, the view didn't return the same as when I created it. The price
> column of the returned record set showed the invoice date instead of the
> price and some other columns also contained wrong information.
> After recreating the view everything was fine again.
> How can this happen?
> Cheers
> Ferdinand