# 1.11 Analysis Template

In this lesson we will learn how create an Analysis Template and re-use it for new data.

1. Continue with the project file saved from the previous lesson. Create a new folder in Project Explorer and rename it as Analysis Template. Open the empty folder.
2. Create a new workbook and import the file <Origin EXE Path>\Samples\Curve Fitting\Sensor01.dat.
3. Highlight column B and select Plot > Templates: User Templates: My Line to create a line graph from the graph template My_Line.otp that we saved in lesson 1.
4. With the graph window active, select Analysis: Fitting: Linear Fit from menu. This will bring up the Linear Fit dialog.
5. In the Fit Control tab, select the Fix Intercept check box to force the fitted curve go through (0,0). Select Auto for Recalculate. Click OK to perform the linear fit. The fitted curve and a result table will be added to the graph.
6. Right-click on the result table and select Quantities in Table from the context menu. In the dialog, remove all entries other than Slope and Adj. R-Square, then click OK to update the table.
7. Double-click on the X axis to open the Axis dialog. With the Scale tab active, hold down the Ctrl key and select both Horizontal and Vertical in the list box on the left. Change Rescale to Auto and click OK. This is to make sure the axis range will update when data changes.
8. Select the legend on the graph and delete it.
9. Go back to the source workbook. Right-click on any one of the sheet tabs and select Add Graph as Sheet from the context menu.
10. In the Graph Browser dialog that opens, select Active Folder from the location drop-down list. Only the line graph in the current folder will be displayed. Select the graph and click OK to insert it as an embedded graph inside a new worksheet.
11. Now we have source data and all analysis results in one book. Let's save it as an Analysis Template. Select File: Save Workbook as Analysis Template... from menu. Save the workbook as My Sensor Analysis.ogw.
12.  Any work book which has an operation linking input and output, indicated by a lock on output sheets or columns, can be saved as an analysis template. The simplest example would be a sheet where column value calculations have been performed.
13. Now use the File: Recent Books menu command to open My Sensor Analysis.ogw. The analysis template will open. Note that the date sheet, results and graphs are empty.
14. With the first data worksheet active, import another data file <Origin EXE Path>\Samples\Curve Fitting\Sensor02.dat.
15. The linear regression results and the embedded graph will update automatically, because we had set the Recalculate mode in the linear fit tool to Auto.
 Analysis templates can be used manually to process one file at a time, or can be used to perform batch analysis of multiple data files or datasets. Please view the Batch Processing tutorial to learn more.