Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

SQL code for Mean Absolute Percentage Error (MAPE) Expand / Collapse
Author
Message
Posted Friday, March 08, 2013 12:40 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, March 08, 2013 4:11 AM
Points: 1, Visits: 5
Hello,

I'm have started coding using SQL recently. I have a task to develop Mean Absolute Percentage Error (MAPE) using SQL-T code. This is a forecast error calculation. I'm doing this for a group of items and each item has about 6months demand history.

I have already done the code to return six months history of data that contains demand(D) and Forecast (F). For one item the demand and forecast history is below. The formular for MAPE is below. I want the sql code to calculate it.
Demand|6| 7|8|7|3|24|
Forecast|4| 9|6|3|1|28|
AbsError(D-F)|2| 2|2|4|2| 4|
(AbsError/Demand)%|33%|29%|25%|57%|66%|16,7%|
MAPE =Average((AbsError/Demand)%) =38%

Pls help :)
Post #1428431
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse