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.
Author |
Topic |
yosiasz
Master Smack Fu Yak Hacker
1635 Posts |
Posted - 2014-02-06 : 18:01:13
|
Greetings allI 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.00How can I dynamically convert the quantity of sales to figure out the score?ThanksGo 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] |
|
|
yosiasz
Master Smack Fu Yak Hacker
1635 Posts |
Posted - 2014-02-06 : 19:44:07
|
table structurecreate 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 resultAssetid Score1 0.032 0.99etc, sample data coming right up<><><><><><><><><><><><><><><><><>If you don't have the passion to help people, you have no passion |
|
|
|
|
|
|
|