How to Edit Datatype of a Column/Variable in Tableau

Tableau is very smart software, it automatically detect and assign datatype to Variables while making connection with data source.
However, it also provide facility to Change datatype of variable, sometime we need data to be in a particular datatype so here are some stages in which we change datatype of existing variable-

From Datasource Page

First option to change the datatype of a variable is from Datasource Pane, Click on Datatype icon of a variable in data source pane and choose datatype from dropdown list, this is how we can change the datatype from datasource pane. See below screenshot-
datatype from datasource pane



From Data Pane


After Connection, when data is already loaded in tableau, also from data pane we can change the datatype, Cick on Datatype icon of a variable in data pane on worksheet and choose datatype from dropdown list. See below screenshot- 
datatype from data pane


From Data View

Also From dataview of a worksheet right click on any variable and choose option change datatype to change the datatype of a variable see below screenshot -
datatype from data view