Forum Discussion
(Help) Working with large sets of multi dimensional JSON files from DocumentDB (Cosmos DB)
- Anonymous9 years ago
Hi otjena,
You can refer to below steps to manual analysis these data and split them to new tables:
1. Convert json source to table.
Query:
let Source = Json.Document(File.Contents("C:\Users\xxxxx\Desktop\new 5.json")), #"Converted to Table" = Record.ToTable(Source), #"Transposed Table" = Table.Transpose(#"Converted to Table"), #"Promoted Headers" = Table.PromoteHeaders(#"Transposed Table", [PromoteAllScalars=true]) in #"Promoted Headers"2. Use Table.SelectColumns function to create the split tables.
3. Analysis and expand these data.
Full query:
Record: let Source = Table.SelectColumns(SourceTable,{"id","success"}) in Source Stats: let Source = Table.SelectColumns(SourceTable,{"id","data"}), #"Added Custom" = Table.SelectColumns(Table.AddColumn(Source, "stats", each Record.FieldValues([data][stats])),{"id","stats"}), #"Expanded stats" = Table.ExpandListColumn(#"Added Custom", "stats") in #"Expanded stats" Tests: let Source = Table.SelectColumns(SourceTable,{"id","tests"}), #"Expanded tests" = Table.ExpandRecordColumn(Table.ExpandListColumn(Source, "tests"), "tests", {"data"}, {"data"}) in #"Expanded tests"Regards,
Xiaoxin Sheng
Hi otjena,
I'd like to suggest you turn on the "paralla loading of tables" feature, it may increase the refresh preformance.
Notice: all of expand tables are based on source table, so these tables will waiting for refreshing of source table .
Regards,
Xiaoxin Sheng
Hello Anonymous
That one was already active, but thanks for the tip!
It might be as you say, that the oter tables is in fact waiting for the source one and I am misslead to beleave that they all contact the database.
I will mark this one as answered, thanks for all the help you have been giving me!
Regards
Otjena