RB160458
New member
- Joined
- Dec 19, 2019
- Messages
- 8
- Reaction score
- 0
- Points
- 0
- Excel Version(s)
- Excel 365
I've noticed an interesting article by Chris Webb on Table.Partition
https://blog.crossjoin.co.uk/2014/10/07/creating-histograms-with-power-query/
and I'm trying to use the function to split a large table into subsets.
I seem to be able to split the table into a list of tables owever when I try and access one of the sub tables I am getting an error
Expression.Error: We cannot convert the value "Sub-Saharan Africa" to type Number.
Details:
Value=Sub-Saharan Africa
Type=[Type]
The sample data that I am using comes from http://eforexcel.com/wp/downloads-18-sample-csv-files-data-sets-for-testing-sales/
https://blog.crossjoin.co.uk/2014/10/07/creating-histograms-with-power-query/
and I'm trying to use the function to split a large table into subsets.
Code:
let
Source = Csv.Document(File.Contents("C:\Users\richa\Excel\PowerQuery\PowerQuery Data\500000 Sales Records.csv"),[Delimiter=",", Columns=14, Encoding=1252, QuoteStyle=QuoteStyle.None]),
#"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),
BucketHashFunction = (Region) as text => Region,
Partitioned = Table.Partition(#"Promoted Headers","Region", 7, BucketHashFunction),
Partitioned1 = Partitioned{0}
in
Partitioned1
Expression.Error: We cannot convert the value "Sub-Saharan Africa" to type Number.
Details:
Value=Sub-Saharan Africa
Type=[Type]
The sample data that I am using comes from http://eforexcel.com/wp/downloads-18-sample-csv-files-data-sets-for-testing-sales/
Last edited by a moderator: