Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 scoring a product

Author  Topic 

yosiasz
Master Smack Fu Yak Hacker

1635 Posts

Posted - 2014-02-06 : 18:01:13
Greetings all

I want to give all of my live assets a score based on order history. the score will be determined by some BI rules but basically how many orders against that product. the score will be between 0 - 1 no higher.
score will be decimal 0.00 to 1.00

How can I dynamically convert the quantity of sales to figure out the score?

Thanks
Go Hawks!

<><><><><><><><><><><><><><><><><>
If you don't have the passion to help people, you have no passion

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2014-02-06 : 18:36:56
please post your table structure, sample data and expected result


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

yosiasz
Master Smack Fu Yak Hacker

1635 Posts

Posted - 2014-02-06 : 19:44:07
table structure

create table dbo.AssetScore(Assetid int , Score decimal(3,2))

create table dbo.Order(AssetId int, OrderDate Datetime, Qty int, price money)

create table dbo.Asset(AssetId int, AssetSku varchar(50), AssetDescription varchar(100))

expected result
Assetid Score
1 0.03
2 0.99

etc, sample data coming right up

<><><><><><><><><><><><><><><><><>
If you don't have the passion to help people, you have no passion
Go to Top of Page
   

- Advertisement -