Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

SQL Loop to Exclude Records

$
0
0

I need help with automating a process in SQL Server.  I want to use a loop to exclude certain records.

  1.       Calculate the impact  of each record to the “Average Selling Price” in the attached excel file.
    1.       For example, If you were to exclude the Aguirre purchase of SKU A in the US, what would be the “Average Selling Price” for A in the US?
    2.      Additionally, after itinerating over the 4 transaction for SKU B in the US, what is the ranking of each transaction regarding the impact to the ASP?

countryskucustomerunitssalesunit priceAverage Selling Price
usaaguirre101001015.55555556
usawirt100200020
usaemrich35016.66667
usbaguirre341002.9411769.190627744
usbwirt67200029.85075
usbemrich34501.470588
usbjory20502.5



 

Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>