Table of contents
TOC
Collapse the table of content
Expand the table of content

Table.TransformColumnTypes

Owen Duncan|Last Updated: 10/5/2018
|
1 Contributor

About

Transforms the column types from a table using a type.

Table.TransformColumnTypes(table as table, typeTransformations as list, optional culture as nullable text) as table  

Arguments

ArgumentDescription
tableThe Table to modify.
typeTransformationsThe List of typeTransofrmations to make.
optional cultureA text value corresponding to the culture values supported on your version of Windows, such as "en-US". If the culture is not specified, the current user culture is used. For a list of culture names, see National Language Support (NLS) API Reference.

Examples

Table.TransformColumnTypes(  
 Table.FromRecords({  
 [A="1",B=2], [A="5", B=10]}),   
 {"A", type number})  
  
 equals Table.FromRecords({  
 [A=1,B=2], [A=5,B=10]})  
Table.TransformColumnTypes(  
 Table.FromRecords({  
 [A="1",B=2],   
 [A="5", B=10]}),  
 {"X", type number})  
  
 equals Expression.Error  
Table.TransformColumnTypes(  
 Table.FromRecords({  
 [A="1/10/1990",B="29,000"],   
 [A="2/10/1990", B="29.000"]}),   
 {{"A", type date}, {"B", type number}}, "en-US")  
  
 equals Table.FromRecords({  
 [A=#date(1990, 10, 1),B=29000],   
 [A=#date(1990, 10, 2),B=29]})  
© 2018 Microsoft