Last active
September 28, 2016 13:43
-
-
Save swbuehler/88cd22d4d5f356a7ed168a05f02dfb78 to your computer and use it in GitHub Desktop.
Power Query M code to process JSON file from Twitch.tv Import
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let | |
Source = Json.Document(File.Contents("C:\Temp\missellacronin.json")), | |
#"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error), | |
#"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"created_at", "notifications", "user"}, {"created_at", "notifications", "user"}), | |
#"Expanded user" = Table.ExpandRecordColumn(#"Expanded Column1", "user", {"_id", "name", "created_at", "updated_at", "display_name", "logo", "bio", "type"}, {"user._id", "user.name", "user.created_at", "user.updated_at", "user.display_name", "user.logo", "user.bio", "user.type"}), | |
#"Changed Type" = Table.TransformColumnTypes(#"Expanded user",{{"created_at", type datetimezone}, {"user.created_at", type datetimezone}, {"user.updated_at", type datetimezone}}), | |
#"Calculated Local Time" = Table.TransformColumns(#"Changed Type",{{"created_at", DateTimeZone.ToLocal, type datetimezone}, {"user.created_at", DateTimeZone.ToLocal, type datetimezone}, {"user.updated_at", DateTimeZone.ToLocal, type datetimezone}}), | |
#"Sorted Rows" = Table.Sort(#"Calculated Local Time",{{"created_at", Order.Descending}}) | |
in | |
#"Sorted Rows" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment