Hi Krishna,
Q) Is there any way to use local services in Analysis widget instead of AGOL services..?
Yes with ArcGIS 10.4 for Server, which includes Portal for ArcGIS. In the 10.4 release, Portal for ArcGIS includes the perform analysis capabilities in the Portal map viewer. See the help topic:
Perform analysis—Portal for ArcGIS | ArcGIS for Server
This functionality utilizes the new SpatialAnalysisTools GP service that is included with ArcGIS Server 10.4 (i.e., the GIS Server). When Portal for ArcGIS 10.4 is configured with a hosting server (e.g., using a dedicated 10.4 Server site + ArcGIS Data Store), the SpatialAnalysisTools GP service powers the Portal map viewer perform analysis tools.
I'm providing this background for context, as the Analysis widget in Web AppBuilder uses the same perform analysis capabilities. So, for both the embedded Web AppBuilder in Portal for ArcGIS 10.4 and Web AppBuilder Developer Edition v1.3, you can enable the Analysis widget to work with Portal for ArcGIS 10.4; which behind the scenes uses the SpatialAnalysisTools GP service in a hosting server configuration.
FYI: the SpatialAnalysisTools GP service will power most of the functionality in the Analysis widget with the exception of the following,
- Enrich Layer
- Create Viewshed
- Create Watershed
- Trace Downstream
- Create Drive-Time Areas
- Find Nearest
- Plan Routes
- Connect Origins to Destinations
The functionality to power these tools will require additional utility services, either from ArcGIS Online registered with your Portal, or you will have to provide them yourself.
Hope this helps,