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

Friday, March 23, 2012

I want to show sales price

Hello

I have a cube and I need to show sales price but if I use like atributte i can show the sales price at the moment sale.

Can you heep me?

Please,

can you post more details to better understand your problem?

Francesco

|||

Sorry but my English is not good.

I have a Dimension Product and Sales Fact Table

My DIm have this attributes: Album, Artist ,Track Name and Price

My Fact Table has this columns PoroductID, Quanty, SalesPrice, Total

And in the fact table I calculate the total to avoid make a calculated mesure.

But the price can change in the future, and I need a Report like this

Track Name, Quantity, Price, Total

I love you, 3, $5.00, $15.00

But if the price chnge in the future. How Can I show the Price at the moment of the sale.

Thanks

|||

Well I'll try to make the things simple...

You have a fact table with a foreign key to your dimension table.

Some information are stored in the fact table (your facts/measures) and others (attributes of facts) are stored in dimension table.

Usually you have a date dimension because you make a "snapshot" of your facts and put it into your fact table, so you have to record the date of that snapshot.

Well, in your case, if I've understood, you have a "SalesPrice" that is your fact.

Probably you record in that column the value of the price at the moment of the sale.

So if you query that value for a certain date you'll obtain the value of the price at "that" date.

In the dimension you'll record the price of the product at the date .... it depends from what kind of dimension (or what kind of update you usally do to that dimension)

If you have a SCD (Slowly Changing Dimension) type I you update the value every time you update dimension so you'll have ever the last value

If you choose a SCD type II you'll register every changing in dimension value adding new member. In this way you record all the story of the dimension because every member is a "snapshot" at a certain date of the entity it represent.

As I told the story is longer, but you can find more information on BOL, on the WEB and in almost every book about SSAS.

Francesco

|||

Thanks a lot!!

|||

Hello Again

I nedd to show the TOP 100 most sales tracks.

Do you have an idea?

Thanks

sql

I want to show sales price

Hello

I have a cube and I need to show sales price but if I use like atributte i can show the sales price at the moment sale.

Can you heep me?

Please,

can you post more details to better understand your problem?

Francesco

|||

Sorry but my English is not good.

I have a Dimension Product and Sales Fact Table

My DIm have this attributes: Album, Artist ,Track Name and Price

My Fact Table has this columns PoroductID, Quanty, SalesPrice, Total

And in the fact table I calculate the total to avoid make a calculated mesure.

But the price can change in the future, and I need a Report like this

Track Name, Quantity, Price, Total

I love you, 3, $5.00, $15.00

But if the price chnge in the future. How Can I show the Price at the moment of the sale.

Thanks

|||

Well I'll try to make the things simple...

You have a fact table with a foreign key to your dimension table.

Some information are stored in the fact table (your facts/measures) and others (attributes of facts) are stored in dimension table.

Usually you have a date dimension because you make a "snapshot" of your facts and put it into your fact table, so you have to record the date of that snapshot.

Well, in your case, if I've understood, you have a "SalesPrice" that is your fact.

Probably you record in that column the value of the price at the moment of the sale.

So if you query that value for a certain date you'll obtain the value of the price at "that" date.

In the dimension you'll record the price of the product at the date .... it depends from what kind of dimension (or what kind of update you usally do to that dimension)

If you have a SCD (Slowly Changing Dimension) type I you update the value every time you update dimension so you'll have ever the last value

If you choose a SCD type II you'll register every changing in dimension value adding new member. In this way you record all the story of the dimension because every member is a "snapshot" at a certain date of the entity it represent.

As I told the story is longer, but you can find more information on BOL, on the WEB and in almost every book about SSAS.

Francesco

|||

Thanks a lot!!

|||

Hello Again

I nedd to show the TOP 100 most sales tracks.

Do you have an idea?

Thanks

Friday, February 24, 2012

I need Help.

Hi. I'm trying a SQL like this
SELECT MIN(PRICE) FROM TABLE1 WHERE ID=112 AND STATUS=1 GROUP BY ID
its returns me
PRICE
100
150
30
But i lik SQL like this
SELECT SUM(MIN(PRICE)) FROM TABLE1 WHERE ID=112 AND STATUS=1 GROUP BY ID
i want return like
PRICE
280
When i runs second SQL an error happens.
" Cannot perform an aggregate function on an expression containing an
aggregate or a subquery. "
_____________________________________________________________
Murat FÝDANOne way
SELECT SUM(MinPrice)AS SumPrice
FROM (SELECT MIN(PRICE) AS MinPrice
FROM TABLE1
WHERE ID=3D112
AND STATUS=3D1
GROUP BY ID )x
Denis The SQL Menace
http://sqlservercode.blogspot.com
http://sqlblog.com/blogs/denis_gobo/default.aspx
On Aug 23, 9:04 am, "Murat Fidan" <murat.fi...@.tekdurak.com> wrote:
> Hi. I'm trying a SQL like this
> SELECT MIN(PRICE) FROM TABLE1 WHERE ID=3D112 AND STATUS=3D1 GROUP BY ID
> its returns me
> PRICE
> 100
> 150
> 30
> But i lik SQL like this
> SELECT SUM(MIN(PRICE)) FROM TABLE1 WHERE ID=3D112 AND STATUS=3D1 GROUP BY= ID
> i want return like
> PRICE
> 280
> When i runs second SQL an error happens.
> " Cannot perform an aggregate function on an expression containing an
> aggregate or a subquery. "
> _____________________________________________________________
> Murat F=DDDAN|||Murat Fidan,
Use a derived table.
select sum(min_price)
from
(
SELECT MIN(PRICE) as min_price
FROM TABLE1
WHERE ID=112 AND STATUS=1
GROUP BY ID
) as t
go
AMB
"Murat Fidan" wrote:
> Hi. I'm trying a SQL like this
> SELECT MIN(PRICE) FROM TABLE1 WHERE ID=112 AND STATUS=1 GROUP BY ID
> its returns me
> PRICE
> 100
> 150
> 30
> But i lik SQL like this
> SELECT SUM(MIN(PRICE)) FROM TABLE1 WHERE ID=112 AND STATUS=1 GROUP BY ID
> i want return like
> PRICE
> 280
>
> When i runs second SQL an error happens.
> " Cannot perform an aggregate function on an expression containing an
> aggregate or a subquery. "
>
> _____________________________________________________________
> Murat FÃ?DAN
>
>