Hi Teacher,
I would like to know if this programming is your own or is this part of the code of the web page?
Coronavirus Excel Stats Update - Pull in New Columns Automaticallyhttps://www.youtube.com/watch?v=vXoKKLxbzVE&t=2s
-----------------------------------------------------------------------------------------------------------------
= (table as table) as table =>
let
Top200Rows = Table.FirstN(table, 200), //we use up to 200 rows to establish a column type
ColumnNameList = Table.ColumnNames(Top200Rows),
ColumnDataLists = List.Accumulate(ColumnNameList, {}, (accumulated, i) => accumulated & {Table.Column(Top200Rows, i)}),
ColumnTypes = List.Transform(ColumnDataLists, (i) => List.ItemType(i)),
TransformList = List.Zip({ColumnNameList, ColumnTypes}),
TypedTable = Table.TransformColumnTypes(table, TransformList),
List.ItemType = (list as list) =>
let
ItemTypes = List.Transform(
list,
each if Value.Type(Value.FromText(_)) = type null then type any
else if Value.Type(Value.FromText(_)) = type number then
if Number.IntegerDivide(Value.FromText(_), 1) = Value.FromText(_) then Int64.Type else type number
else Value.Type(Value.FromText(_))
),
ListItemType = Type.Union(ItemTypes)
in
ListItemType
in
TypedTable
--------------------------------------------------------------------------------------------------------
Kind Regards,
Katherine.