I have a situation where I have to get the result in SQL of somehow complex calculation which we were previously doing it in Ms Excel. Attached is the file to see the table structure and data. Now by keeping in mind the structure of the table, kindly help how to solve the following formula for "UK" where "LocationID" is different but "LocationSubID" are same.
Average = (((Itemsold_month-Itemsold_day)*Itemsold_total)+((Itemsold_month-Itemsold_day)*Itemsold_total))/(Itemsold_month-Itemsold_day)
This formula will be used to calculate for both entries of "UK" but their will be a single value, say "Average"
Please guide. If need any further clarification then please let me know.
P.S. This formula can be simplified but need to calculate the result using above mentioned formula only