let
Source = {1..4},
#"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Changed Type" = Table.TransformColumnTypes(#"Converted to Table",{{"Column1", type text}}),
Pagination = Table.AddColumn(#"Changed Type", "Custom", each Json.Document(Web.Contents("https://REDHATSATELITTE/api/job_invocations?page="&[Column1]))),
#"Expanded Custom" = Table.ExpandRecordColumn(Pagination, "Custom", {"total", "subtotal", "page", "per_page", "search", "sort", "results"}, {"total", "subtotal", "page", "per_page", "search", "sort", "results"}),
#"Removed Columns" = Table.RemoveColumns(#"Expanded Custom",{"Column1", "total", "subtotal", "page", "per_page", "search", "sort"}),
#"Expanded results" = Table.ExpandListColumn(#"Removed Columns", "results"),
Results = Table.ExpandRecordColumn(#"Expanded results", "results", {"description", "job_category", "targeting_id", "status", "start_at", "status_label", "succeeded", "failed", "pending", "total"}, {"description", "job_category", "targeting_id", "status", "start_at", "status_label", "succeeded", "failed", "pending", "total"}),
#"Replaced UTC" = Table.ReplaceValue(Results," UTC","",Replacer.ReplaceText,{"start_at"}),
#"Changed type Time/Date" = Table.TransformColumnTypes(#"Replaced UTC",{{"start_at", type datetime}}),
#"Postcheck Only" = Table.SelectRows(#"Changed type Time/Date", each ([description] = "OPR-PATCHING-POSTCHECK - NON-PROD" or [description] = "OPR-PATCHING-POSTCHECK - PROD" or [description] = "OPR-PATCHING-POSTCHECK-NON-PROD" or [description] = "OPR-PATCHING-POSTCHECK-NON-PROD-D1" or [description] = "OPR-PATCHING-POSTCHECK-PROD" or [description] = "OPR-PATCHING-POSTCHECK-PROD-D1" or [description] = "OPR-PATCHING-POSTCHECK-SPE-OracleCman-NON-PROD-D0" or [description] = "OPR-PATCHING-POSTCHECK-SPE-OracleCman-NON-PROD-D1" or [description] = "OPR-PATCHING-POSTCHECK-SPE-OracleCman-PROD-D0" or [description] = "OPR-PATCHING-POSTCHECK-SPE-OracleCman-PROD-D1" or [description] = "OPR-PATCHING-POSTCHECK-SPE-OracleCman-TEST-GROUP-D0" or [description] = "OPR-PATCHING-POSTCHECK-SPE-OracleCman-TEST-GROUP-D1" or [description] = "OPR-PATCHING-POSTCHECK-SPE-OracleRacLan-NON-PROD-D0" or [description] = "OPR-PATCHING-POSTCHECK-SPE-OracleRacLan-NON-PROD-D1" or [description] = "OPR-PATCHING-POSTCHECK-SPE-OracleRacLan-TEST-GROUP-D0" or [description] = "OPR-PATCHING-POSTCHECK-SPE-OracleRacLan-TEST-GROUP-D1" or [description] = "OPR-PATCHING-POSTCHECK-SPE-SapCluster-NON-PROD-D0" or [description] = "OPR-PATCHING-POSTCHECK-SPE-SapCluster-NON-PROD-D1" or [description] = "OPR-PATCHING-POSTCHECK-SPE-SapCluster-PROD-D0" or [description] = "OPR-PATCHING-POSTCHECK-SPE-SapCluster-PROD-D1" or [description] = "OPR-PATCHING-POSTCHECK-SPE-SapCluster-TEST-GROUP-D0" or [description] = "OPR-PATCHING-POSTCHECK-SPE-SapCluster-TEST-GROUP-D1" or [description] = "OPR-PATCHING-POSTCHECK-SPE-SapHana-NON-PROD-D0" or [description] = "OPR-PATCHING-POSTCHECK-SPE-SapHana-PROD-D0" or [description] = "OPR-PATCHING-POSTCHECK-SPE-SapHana-TEST-GROUP-D0" or [description] = "OPR-PATCHING-POSTCHECK-TEST-GROUP" or [description] = "OPR-PATCHING-POSTCHECK-TEST-GROUP-D1")),
#"Sorted Rows" = Table.Sort(#"Postcheck Only",{{"description", Order.Ascending}}),
Env = Table.AddColumn(#"Sorted Rows", "Env", each if [description] = "OPR-PATCHING-POSTCHECK-TEST-GROUP" then "TEST GROUP Day 0" else if [description] = "OPR-PATCHING-POSTCHECK-TEST-GROUP-D1" then "TEST GROUP Day 1" else if [description] = "OPR-PATCHING-POSTCHECK-NON-PROD" then "NON-PROD Day 0" else if [description] = "OPR-PATCHING-POSTCHECK-NON-PROD-D1" then "NON-PROD Day 1" else if [description] = "OPR-PATCHING-POSTCHECK-PROD" then "PROD Day 0" else if [description] = "OPR-PATCHING-POSTCHECK-PROD-D1" then "PROD Day 1" else if Text.Contains([description], "OPR-PATCHING-POSTCHECK-SPE-OracleCman-TEST-GROUP-D0") then "TEST GROUP Day 0" else if Text.Contains([description], "OPR-PATCHING-POSTCHECK-SPE-OracleCman-TEST-GROUP-D1") then "TEST GROUP Day 1" else if Text.Contains([description], "OPR-PATCHING-POSTCHECK-SPE-OracleCman-NON-PROD-D0") then "NON-PROD Day 0" else if Text.Contains([description], "OPR-PATCHING-POSTCHECK-SPE-OracleCman-NON-PROD-D1") then "NON-PROD Day 1" else if Text.Contains([description], "OPR-PATCHING-POSTCHECK-SPE-OracleCman-PROD-D0") then "PROD Day 0" else if Text.Contains([description], "OPR-PATCHING-POSTCHECK-SPE-OracleCman-PROD-D1") then "PROD Day 1" else if Text.Contains([description], "OPR-PATCHING-POSTCHECK-SPE-OracleRacLan-TEST-GROUP-D0") then "TEST GROUP Day 0" else if Text.Contains([description], "OPR-PATCHING-POSTCHECK-SPE-OracleRacLan-TEST-GROUP-D1") then "TEST GROUP Day 1" else if Text.Contains([description], "OPR-PATCHING-POSTCHECK-SPE-OracleRacLan-NON-PROD-D0") then "NON-PROD Day 0" else if Text.Contains([description], "OPR-PATCHING-POSTCHECK-SPE-OracleRacLan-NON-PROD-D1") then "NON-PROD Day 1" else if Text.Contains([description], "OPR-PATCHING-POSTCHECK-SPE-OracleRacLan-PROD-D0") then "PROD Day 0" else if Text.Contains([description], "OPR-PATCHING-POSTCHECK-SPE-OracleRacLan-PROD-D1") then "PROD Day 1" else if Text.Contains([description], "OPR-PATCHING-POSTCHECK-SPE-SapCluster-TEST-GROUP-D0") then "TEST GROUP Day 0" else if Text.Contains([description], "OPR-PATCHING-POSTCHECK-SPE-SapCluster-TEST-GROUP-D1") then "TEST GROUP Day 1" else if Text.Contains([description], "OPR-PATCHING-POSTCHECK-SPE-SapCluster-NON-PROD-D0") then "NON-PROD Day 0" else if Text.Contains([description], "OPR-PATCHING-POSTCHECK-SPE-SapCluster-NON-PROD-D1") then "NON-PROD Day 1" else if Text.Contains([description], "OPR-PATCHING-POSTCHECK-SPE-SapCluster-PROD-D0") then "PROD Day 0" else if Text.Contains([description], "OPR-PATCHING-POSTCHECK-SPE-SapCluster-PROD-D1") then "PROD Day 1" else if Text.Contains([description], "OPR-PATCHING-POSTCHECK-SPE-SapHana-TEST-GROUP-D0") then "TEST GROUP Day 0" else if Text.Contains([description], "OPR-PATCHING-POSTCHECK-SPE-SapHana-TEST-GROUP-D1") then "TEST GROUP Day 1" else if Text.Contains([description], "OPR-PATCHING-POSTCHECK-SPE-SapHana-NON-PROD-D0") then "NON-PROD Day 0" else if Text.Contains([description], "OPR-PATCHING-POSTCHECK-SPE-SapHana-NON-PROD-D1") then "NON-PROD Day 1" else if Text.Contains([description], "OPR-PATCHING-POSTCHECK-SPE-SapHana-PROD-D0") then "PROD Day 0" else if Text.Contains([description], "OPR-PATCHING-POSTCHECK-SPE-SapHana-PROD-D1") then "PROD Day 1" else null),
#"Reordered Columns" = Table.ReorderColumns(Env,{"description", "Env", "job_category", "targeting_id", "status", "start_at", "status_label", "succeeded", "failed", "pending", "total"}),
#"Sorted Rows1" = Table.Sort(#"Reordered Columns",{{"start_at", Order.Ascending}}),
#"Renamed Columns" = Table.RenameColumns(#"Sorted Rows1",{{"start_at", "Date"}}),
#"Changed Type Date/Time" = Table.TransformColumnTypes(#"Renamed Columns",{{"Date", type datetime}}),
#"Filtered Rows (null)" = Table.SelectRows(#"Changed Type Date/Time", each ([Env] <> null) and ([Date] <> #datetime(2021, 3, 18, 5, 0, 0) and [Date] <> #datetime(2021, 3, 18, 5, 30, 0) and [Date] <> #datetime(2021, 3, 19, 5, 30, 0) and [Date] <> #datetime(2021, 4, 21, 4, 0, 0) and [Date] <> #datetime(2021, 4, 21, 5, 30, 0) and [Date] <> #datetime(2021, 4, 22, 4, 0, 0) and [Date] <> #datetime(2021, 4, 22, 5, 30, 0) and [Date] <> #datetime(2050, 12, 25, 5, 0, 0) and [Date] <> #datetime(2050, 12, 25, 5, 30, 0) and [Date] <> #datetime(2050, 12, 25, 6, 30, 0) and [Date] <> #datetime(2050, 12, 26, 5, 0, 0) and [Date] <> #datetime(2050, 12, 26, 5, 30, 0) and [Date] <> #datetime(2050, 12, 26, 6, 30, 0))),
#"Grouped Rows" = Table.Group(#"Filtered Rows (null)", {"Env"}, {{"Total", each List.Sum([total]), type number}, {"Patched", each List.Sum([succeeded]), type number}, {"Not Patched", each List.Sum([failed]), type number}})
in
#"Grouped Rows"
Bookmarks