forked from frenchlam/DBKS_SQL_training_july3rd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Flight Dashboard.lvdash.json
1 lines (1 loc) · 9.74 KB
/
Flight Dashboard.lvdash.json
1
{"datasets":[{"name":"8039d40d","displayName":"Cancelled Flights - By Carriers - Aggregated","query":"SELECT \n UniqueCarrier AS carrier_code, \n airlines.Description AS carrier_description, \n SUM(cancelled) AS nb_cancelled,\n SUM(1) AS nb_fligts,\n (SUM(cancelled) / COUNT(*)) * 100 AS percentage_cancelled\nFROM dbsql_workshop.flights_perf.flight_optim_zorder\nJOIN dbsql_workshop.flights_perf.airlines\nON flight_optim_zorder.UniqueCarrier = airlines.UniqueCode\nGROUP BY carrier_code, carrier_description\nORDER BY percentage_cancelled DESC"},{"name":"86b7fa3d","displayName":"Cancelled flights By Carriers - By Months","query":"SELECT \n year, \n month, \n date(CONCAT(year, '-', month, '-01')) AS year_month_datetime,\n UniqueCarrier AS carrier_code, \n airlines.Description AS carrier_description,\n sum(cancelled) AS nb_cancelled,\n sum(1) AS nb_flights,\n (sum(cancelled) / sum(1)) * 100 AS percent_cancelled\nFROM \n dbsql_workshop.flights_perf.flight_optim_zorder\nJOIN \n dbsql_workshop.flights_perf.airlines\nON \n flight_optim_zorder.UniqueCarrier = airlines.UniqueCode\nWHERE \n isnotnull(flight_optim_zorder.Cancelled) \n AND isnotnull(flight_optim_zorder.year)\nGROUP BY \n year, \n month, \n year_month_datetime, \n carrier_code, \n carrier_description"}],"pages":[{"name":"e9f99597","displayName":"New Page","layout":[{"widget":{"name":"c41e5363","queries":[{"name":"dashboards/01eee151a3b81a659c9cb5317501fff9/datasets/01eee179faa018468ee3f42dc7eb2071_year","query":{"datasetName":"86b7fa3d","fields":[{"name":"year","expression":"`year`"},{"name":"year_associativity","expression":"COUNT_IF(`associative_filter_predicate_group`)"}],"disaggregated":false}}],"spec":{"version":2,"widgetType":"filter-single-select","encodings":{"fields":[{"fieldName":"year","displayName":"year","queryName":"dashboards/01eee151a3b81a659c9cb5317501fff9/datasets/01eee179faa018468ee3f42dc7eb2071_year"}]},"frame":{"showTitle":true,"title":"Year"},"disallowAll":false}},"position":{"x":2,"y":7,"width":2,"height":2}},{"widget":{"name":"4c926e0e","queries":[{"name":"main_query","query":{"datasetName":"8039d40d","fields":[{"name":"carrier_description","expression":"`carrier_description`"},{"name":"nb_cancelled","expression":"`nb_cancelled`"},{"name":"nb_fligts","expression":"`nb_fligts`"},{"name":"percentage_cancelled","expression":"`percentage_cancelled`"}],"disaggregated":true}}],"spec":{"version":1,"widgetType":"table","encodings":{"columns":[{"fieldName":"carrier_description","booleanValues":["false","true"],"imageUrlTemplate":"{{ @ }}","imageTitleTemplate":"{{ @ }}","imageWidth":"","imageHeight":"","linkUrlTemplate":"{{ @ }}","linkTextTemplate":"{{ @ }}","linkTitleTemplate":"{{ @ }}","linkOpenInNewTab":true,"type":"string","displayAs":"string","visible":true,"order":100001,"title":"carrier_description","allowSearch":false,"alignContent":"left","allowHTML":false,"highlightLinks":false,"useMonospaceFont":false,"preserveWhitespace":false,"displayName":"carrier_description"},{"fieldName":"nb_cancelled","numberFormat":"0","booleanValues":["false","true"],"imageUrlTemplate":"{{ @ }}","imageTitleTemplate":"{{ @ }}","imageWidth":"","imageHeight":"","linkUrlTemplate":"{{ @ }}","linkTextTemplate":"{{ @ }}","linkTitleTemplate":"{{ @ }}","linkOpenInNewTab":true,"type":"integer","displayAs":"number","visible":true,"order":100002,"title":"nb_cancelled","allowSearch":false,"alignContent":"right","allowHTML":false,"highlightLinks":false,"useMonospaceFont":false,"preserveWhitespace":false,"displayName":"nb_cancelled"},{"fieldName":"nb_fligts","numberFormat":"0","booleanValues":["false","true"],"imageUrlTemplate":"{{ @ }}","imageTitleTemplate":"{{ @ }}","imageWidth":"","imageHeight":"","linkUrlTemplate":"{{ @ }}","linkTextTemplate":"{{ @ }}","linkTitleTemplate":"{{ @ }}","linkOpenInNewTab":true,"type":"integer","displayAs":"number","visible":true,"order":100003,"title":"nb_fligts","allowSearch":false,"alignContent":"right","allowHTML":false,"highlightLinks":false,"useMonospaceFont":false,"preserveWhitespace":false,"displayName":"nb_fligts"},{"fieldName":"percentage_cancelled","numberFormat":"0.00","booleanValues":["false","true"],"imageUrlTemplate":"{{ @ }}","imageTitleTemplate":"{{ @ }}","imageWidth":"","imageHeight":"","linkUrlTemplate":"{{ @ }}","linkTextTemplate":"{{ @ }}","linkTitleTemplate":"{{ @ }}","linkOpenInNewTab":true,"type":"float","displayAs":"number","visible":true,"order":100004,"title":"percentage_cancelled","allowSearch":false,"alignContent":"right","allowHTML":false,"highlightLinks":false,"useMonospaceFont":false,"preserveWhitespace":false,"displayName":"percentage_cancelled"}]},"invisibleColumns":[{"booleanValues":["false","true"],"imageUrlTemplate":"{{ @ }}","imageTitleTemplate":"{{ @ }}","imageWidth":"","imageHeight":"","linkUrlTemplate":"{{ @ }}","linkTextTemplate":"{{ @ }}","linkTitleTemplate":"{{ @ }}","linkOpenInNewTab":true,"name":"carrier_code","type":"string","displayAs":"string","order":100000,"title":"carrier_code","allowSearch":false,"alignContent":"left","allowHTML":false,"highlightLinks":false,"useMonospaceFont":false,"preserveWhitespace":false}],"allowHTMLByDefault":false,"itemsPerPage":25,"paginationSize":"default","condensed":true,"withRowNumber":false,"frame":{"showTitle":true,"title":"List of the worst airlines"}}},"position":{"x":2,"y":1,"width":4,"height":6}},{"widget":{"name":"6f66699f","queries":[{"name":"main_query","query":{"datasetName":"86b7fa3d","fields":[{"name":"sum(nb_cancelled)","expression":"SUM(`nb_cancelled`)"}],"disaggregated":false}}],"spec":{"version":2,"widgetType":"counter","encodings":{"value":{"fieldName":"sum(nb_cancelled)","displayName":"Sum of nb_cancelled"}},"frame":{"showTitle":true,"title":"Number of Cancelled Flights"}}},"position":{"x":5,"y":7,"width":1,"height":2}},{"widget":{"name":"2ad99e49","queries":[{"name":"main_query","query":{"datasetName":"86b7fa3d","fields":[{"name":"avg(percent_cancelled)","expression":"AVG(`percent_cancelled`)"},{"name":"carrier_description","expression":"`carrier_description`"},{"name":"month","expression":"`month`"}],"disaggregated":false}}],"spec":{"version":3,"widgetType":"heatmap","encodings":{"x":{"fieldName":"carrier_description","scale":{"type":"categorical"},"displayName":"carrier_description"},"y":{"fieldName":"month","scale":{"type":"categorical"},"displayName":"month"},"color":{"fieldName":"avg(percent_cancelled)","scale":{"type":"quantitative"},"displayName":"Average percent_cancelled"}}}},"position":{"x":3,"y":9,"width":3,"height":6}},{"widget":{"name":"a9a34e0a","textbox_spec":"## Flight Dashboard - Airlines Exploration\n"},"position":{"x":0,"y":0,"width":6,"height":1}},{"widget":{"name":"aff28d94","queries":[{"name":"dashboards/01eee151a3b81a659c9cb5317501fff9/datasets/01eee151c58012b2aedf89f91456d6b2_carrier_description","query":{"datasetName":"8039d40d","fields":[{"name":"carrier_description","expression":"`carrier_description`"},{"name":"carrier_description_associativity","expression":"COUNT_IF(`associative_filter_predicate_group`)"}],"disaggregated":false}},{"name":"dashboards/01eee151a3b81a659c9cb5317501fff9/datasets/01eee179faa018468ee3f42dc7eb2071_carrier_description","query":{"datasetName":"86b7fa3d","fields":[{"name":"carrier_description","expression":"`carrier_description`"},{"name":"carrier_description_associativity","expression":"COUNT_IF(`associative_filter_predicate_group`)"}],"disaggregated":false}}],"spec":{"version":2,"widgetType":"filter-single-select","encodings":{"fields":[{"fieldName":"carrier_description","displayName":"carrier_description","queryName":"dashboards/01eee151a3b81a659c9cb5317501fff9/datasets/01eee179faa018468ee3f42dc7eb2071_carrier_description"},{"fieldName":"carrier_description","displayName":"carrier_description","queryName":"dashboards/01eee151a3b81a659c9cb5317501fff9/datasets/01eee151c58012b2aedf89f91456d6b2_carrier_description"}]},"frame":{"showTitle":true,"title":"Carrier"}}},"position":{"x":0,"y":7,"width":2,"height":2}},{"widget":{"name":"06eb17b8","queries":[{"name":"main_query","query":{"datasetName":"8039d40d","fields":[{"name":"carrier_description","expression":"`carrier_description`"},{"name":"percentage_cancelled","expression":"`percentage_cancelled`"}],"disaggregated":true}}],"spec":{"version":3,"widgetType":"bar","encodings":{"x":{"fieldName":"carrier_description","scale":{"type":"categorical","sort":{"by":"y-reversed"}},"displayName":"carrier_description"},"y":{"fieldName":"percentage_cancelled","scale":{"type":"quantitative"},"displayName":"percentage_cancelled"}},"frame":{"showTitle":true,"title":"Worst airlines per % of cancelled Flights"}}},"position":{"x":0,"y":1,"width":2,"height":6}},{"widget":{"name":"f3543a26","queries":[{"name":"main_query","query":{"datasetName":"86b7fa3d","fields":[{"name":"sum(nb_flights)","expression":"SUM(`nb_flights`)"}],"disaggregated":false}}],"spec":{"version":2,"widgetType":"counter","encodings":{"value":{"fieldName":"sum(nb_flights)","displayName":"Sum of nb_flights"}},"frame":{"showTitle":true,"title":"Number Of Flights"}}},"position":{"x":4,"y":7,"width":1,"height":2}},{"widget":{"name":"8a7269ef","queries":[{"name":"main_query","query":{"datasetName":"86b7fa3d","fields":[{"name":"monthly(year_month_datetime)","expression":"DATE_TRUNC(\"MONTH\", `year_month_datetime`)"},{"name":"sum(nb_cancelled)","expression":"SUM(`nb_cancelled`)"},{"name":"sum(nb_flights)","expression":"SUM(`nb_flights`)"}],"disaggregated":false}}],"spec":{"version":1,"widgetType":"combo","encodings":{"x":{"fieldName":"monthly(year_month_datetime)","scale":{"type":"categorical"},"displayName":"year_month_datetime"},"y":{"primary":{"fields":[]},"secondary":{"fields":[{"fieldName":"sum(nb_cancelled)","displayName":"Sum of nb_cancelled"},{"fieldName":"sum(nb_flights)","displayName":"Sum of nb_flights"}]},"scale":{"type":"quantitative"}}}}},"position":{"x":0,"y":9,"width":3,"height":6}}]}]}