-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPower BI Dataflow ABS Population.json
1 lines (1 loc) · 12.5 KB
/
Power BI Dataflow ABS Population.json
1
{"name":"ABS Population","description":"","version":"1.0","culture":"en-AU","modifiedTime":"2021-05-30T01:11:19.4896385+00:00","pbi:mashup":{"fastCombine":true,"allowNativeQueries":false,"skipAutomaticHeaderAndTypeDetection":false,"queriesMetadata":{"Population - Data 1":{"queryId":"d26af8fd-d17d-477e-ba66-48db507def96","queryName":"Population - Data 1"},"Transform File":{"queryId":"8faa51d6-bfb0-4193-ace5-c612e7a16532","queryName":"Transform File"},"Sample File":{"queryId":"45b7fc70-2db6-4b12-855b-bae47cfad0d1","queryName":"Sample File"},"Population":{"queryId":"207f0a5c-2c6d-4fa9-be1d-203c063bedf6","queryName":"Population","loadEnabled":true},"Population - Data 2":{"queryId":"84f29a84-39e8-4bcc-98ad-95c445142e41","queryName":"Population - Data 2"},"Transform File (2)":{"queryId":"84d88886-7b99-4270-ada5-c486b07b4530","queryName":"Transform File (2)"},"Sample File (2)":{"queryId":"bfe6ff96-a676-4ddc-ab16-6e10e4d5323b","queryName":"Sample File (2)"}},"document":"section Section1;\r\nshared #\"Population - Data 1\" = let\r\n Source = Folder.Files(\"C:\\Dev\\ABS\\Population\"),\r\n #\"Filtered Name\" = Table.SelectRows(Source, each Text.StartsWith([Name], \"ABS Population - \")),\r\n #\"Filtered Extension\" = Table.SelectRows(#\"Filtered Name\", each [Extension] = \".xlsx\"),\r\n #\"Filtered Hidden Files1\" = Table.SelectRows(#\"Filtered Extension\", each [Attributes]?[Hidden]? <> true),\r\n #\"Invoke Custom Function1\" = Table.AddColumn(#\"Filtered Hidden Files1\", \"Transform File\", each #\"Transform File\"([Content])),\r\n #\"Renamed Columns1\" = Table.RenameColumns(#\"Invoke Custom Function1\", {\"Name\", \"Source.Name\"}),\r\n #\"Removed Other Columns1\" = Table.SelectColumns(#\"Renamed Columns1\", {\"Source.Name\", \"Transform File\"}),\r\n #\"Expanded Table Column1\" = Table.ExpandTableColumn(#\"Removed Other Columns1\", \"Transform File\", Table.ColumnNames(#\"Transform File\"(#\"Sample File\")))\r\nin\r\n #\"Expanded Table Column1\";\r\nshared #\"Transform File\" = let\r\n Source = (Parameter1 as binary) => let\n Source = Excel.Workbook(Parameter1, null, true),\n Data1_Sheet = Source{[Item=\"Data1\",Kind=\"Sheet\"]}[Data],\n #\"Transposed Table\" = Table.Transpose(Data1_Sheet),\n #\"Promoted Headers\" = Table.PromoteHeaders(#\"Transposed Table\", [PromoteAllScalars=true]),\n #\"Changed Type\" = Table.TransformColumnTypes(#\"Promoted Headers\",{{\"Column1\", type text}, {\"Unit\", type text}, {\"Series Type\", type text}, {\"Data Type\", type text}, {\"Frequency\", type text}, {\"Collection Month\", Int64.Type}, {\"Series Start\", type date}, {\"Series End\", type date}, {\"No. Obs\", Int64.Type}, {\"Series ID\", type text}, {\"1/06/1971\", Int64.Type}, {\"1/06/1972\", Int64.Type}, {\"1/06/1973\", Int64.Type}, {\"1/06/1974\", Int64.Type}, {\"1/06/1975\", Int64.Type}, {\"1/06/1976\", Int64.Type}, {\"1/06/1977\", Int64.Type}, {\"1/06/1978\", Int64.Type}, {\"1/06/1979\", Int64.Type}, {\"1/06/1980\", Int64.Type}, {\"1/06/1981\", Int64.Type}, {\"1/06/1982\", Int64.Type}, {\"1/06/1983\", Int64.Type}, {\"1/06/1984\", Int64.Type}, {\"1/06/1985\", Int64.Type}, {\"1/06/1986\", Int64.Type}, {\"1/06/1987\", Int64.Type}, {\"1/06/1988\", Int64.Type}, {\"1/06/1989\", Int64.Type}, {\"1/06/1990\", Int64.Type}, {\"1/06/1991\", Int64.Type}, {\"1/06/1992\", Int64.Type}, {\"1/06/1993\", Int64.Type}, {\"1/06/1994\", Int64.Type}, {\"1/06/1995\", Int64.Type}, {\"1/06/1996\", Int64.Type}, {\"1/06/1997\", Int64.Type}, {\"1/06/1998\", Int64.Type}, {\"1/06/1999\", Int64.Type}, {\"1/06/2000\", Int64.Type}, {\"1/06/2001\", Int64.Type}, {\"1/06/2002\", Int64.Type}, {\"1/06/2003\", Int64.Type}, {\"1/06/2004\", Int64.Type}, {\"1/06/2005\", Int64.Type}, {\"1/06/2006\", Int64.Type}, {\"1/06/2007\", Int64.Type}, {\"1/06/2008\", Int64.Type}, {\"1/06/2009\", Int64.Type}, {\"1/06/2010\", Int64.Type}, {\"1/06/2011\", Int64.Type}, {\"1/06/2012\", Int64.Type}, {\"1/06/2013\", Int64.Type}, {\"1/06/2014\", Int64.Type}, {\"1/06/2015\", Int64.Type}, {\"1/06/2016\", Int64.Type}, {\"1/06/2017\", Int64.Type}, {\"1/06/2018\", Int64.Type}, {\"1/06/2019\", Int64.Type}, {\"1/06/2020\", Int64.Type}}),\n #\"Renamed Columns\" = Table.RenameColumns(#\"Changed Type\",{{\"Column1\", \"Series\"}}),\n #\"Unpivoted Other Columns\" = Table.UnpivotOtherColumns(#\"Renamed Columns\", {\"Series\", \"Unit\", \"Series Type\", \"Data Type\", \"Frequency\", \"Collection Month\", \"Series Start\", \"Series End\", \"No. Obs\", \"Series ID\"}, \"Attribute\", \"Value\"),\n #\"Renamed Columns1\" = Table.RenameColumns(#\"Unpivoted Other Columns\",{{\"Attribute\", \"Date\"}}),\n #\"Changed Type1\" = Table.TransformColumnTypes(#\"Renamed Columns1\",{{\"Date\", type date}})\nin\n #\"Changed Type1\"\r\nin\r\n Source;\r\nshared #\"Sample File\" = let\r\n Source = Folder.Files(\"C:\\Dev\\ABS\\Population\"),\r\n #\"Filtered Name\" = Table.SelectRows(Source, each Text.StartsWith([Name], \"ABS Population - \")),\r\n #\"Filtered Extension\" = Table.SelectRows(#\"Filtered Name\", each [Extension] = \".xlsx\"),\r\n Navigation1 = #\"Filtered Extension\"{0}[Content]\r\nin\r\n Navigation1;\r\nshared Population = let\r\n Source = #\"Population - Data 1\",\r\n #\"Appended Query\" = Table.Combine({Source, #\"Population - Data 2\"}),\r\n #\"Inserted Text Between Delimiters2\" = Table.AddColumn(#\"Appended Query\", \"Text Between Delimiters\", each Text.BetweenDelimiters([Source.Name], \" - \", \".\"), type text),\r\n #\"Inserted Text Between Delimiters\" = Table.AddColumn(#\"Inserted Text Between Delimiters2\", \"Text Between Delimiters.1\", each Text.BetweenDelimiters([Series], \";\", \";\"), type text),\r\n #\"Inserted Text Between Delimiters1\" = Table.AddColumn(#\"Inserted Text Between Delimiters\", \"Text Between Delimiters.2\", each Text.BetweenDelimiters([Series], \";\", \";\", 1, 0), type text),\r\n #\"Renamed Columns\" = Table.RenameColumns(#\"Inserted Text Between Delimiters1\", {{\"Text Between Delimiters.1\", \"Gender\"}, {\"Text Between Delimiters.2\", \"Age\"}, {\"Text Between Delimiters\", \"Geography\"}}),\r\n #\"Trimmed Text\" = Table.TransformColumns(#\"Renamed Columns\",{{\"Gender\", Text.Trim, type text}, {\"Age\", Text.Trim, type text}, {\"Geography\", Text.Trim, type text}}),\r\n #\"Replaced Value\" = Table.ReplaceValue(#\"Trimmed Text\", \"100 and over\", \"100\", Replacer.ReplaceText, {\"Age\"}),\r\n #\"Changed Type\" = Table.TransformColumnTypes(#\"Replaced Value\", {{\"Age\", Int64.Type}, {\"Value\", Int64.Type}, {\"Date\", type date}}),\r\n #\"Added Age Category\" = Table.AddColumn(#\"Changed Type\", \"Age Category\", each if [Age] >= 16 then \"Adult\" else \"Child\"),\r\n #\"Transform columns\" = Table.TransformColumnTypes(#\"Added Age Category\", {{\"Series\", type text}, {\"Unit\", type text}, {\"Series Type\", type text}, {\"Data Type\", type text}, {\"Frequency\", type text}, {\"Collection Month\", type text}, {\"Series Start\", type text}, {\"Series End\", type text}, {\"No. Obs\", type text}, {\"Series ID\", type text}, {\"Age Category\", type text}}),\r\n #\"Replace errors\" = Table.ReplaceErrorValues(#\"Transform columns\", {{\"Series\", null}, {\"Unit\", null}, {\"Series Type\", null}, {\"Data Type\", null}, {\"Frequency\", null}, {\"Collection Month\", null}, {\"Series Start\", null}, {\"Series End\", null}, {\"No. Obs\", null}, {\"Series ID\", null}, {\"Age Category\", null}})\r\nin\r\n #\"Replace errors\";\r\nshared #\"Population - Data 2\" = let\r\n Source = Folder.Files(\"C:\\Dev\\ABS\\Population\"),\r\n #\"Filtered Name\" = Table.SelectRows(Source, each Text.StartsWith([Name], \"ABS Population - \")),\r\n #\"Filtered Extension\" = Table.SelectRows(#\"Filtered Name\", each [Extension] = \".xlsx\"),\r\n #\"Filtered Hidden Files1\" = Table.SelectRows(#\"Filtered Extension\", each [Attributes]?[Hidden]? <> true),\r\n #\"Invoke Custom Function1\" = Table.AddColumn(#\"Filtered Hidden Files1\", \"Transform File (2)\", each #\"Transform File (2)\"([Content])),\r\n #\"Renamed Columns1\" = Table.RenameColumns(#\"Invoke Custom Function1\", {\"Name\", \"Source.Name\"}),\r\n #\"Removed Other Columns1\" = Table.SelectColumns(#\"Renamed Columns1\", {\"Source.Name\", \"Transform File (2)\"}),\r\n #\"Expanded Table Column1\" = Table.ExpandTableColumn(#\"Removed Other Columns1\", \"Transform File (2)\", Table.ColumnNames(#\"Transform File (2)\"(#\"Sample File (2)\")))\r\nin\r\n #\"Expanded Table Column1\";\r\nshared #\"Transform File (2)\" = let\r\n Source = (Parameter2 as binary) => let\n Source = Excel.Workbook(Parameter2, null, true),\n Data2_Sheet = Source{[Item=\"Data2\",Kind=\"Sheet\"]}[Data],\n #\"Transposed Table\" = Table.Transpose(Data2_Sheet),\n #\"Promoted Headers\" = Table.PromoteHeaders(#\"Transposed Table\", [PromoteAllScalars=true]),\n #\"Changed Type\" = Table.TransformColumnTypes(#\"Promoted Headers\",{{\"Column1\", type text}, {\"Unit\", type text}, {\"Series Type\", type text}, {\"Data Type\", type text}, {\"Frequency\", type text}, {\"Collection Month\", Int64.Type}, {\"Series Start\", type date}, {\"Series End\", type date}, {\"No. Obs\", Int64.Type}, {\"Series ID\", type text}, {\"1/06/1971\", Int64.Type}, {\"1/06/1972\", Int64.Type}, {\"1/06/1973\", Int64.Type}, {\"1/06/1974\", Int64.Type}, {\"1/06/1975\", Int64.Type}, {\"1/06/1976\", Int64.Type}, {\"1/06/1977\", Int64.Type}, {\"1/06/1978\", Int64.Type}, {\"1/06/1979\", Int64.Type}, {\"1/06/1980\", Int64.Type}, {\"1/06/1981\", Int64.Type}, {\"1/06/1982\", Int64.Type}, {\"1/06/1983\", Int64.Type}, {\"1/06/1984\", Int64.Type}, {\"1/06/1985\", Int64.Type}, {\"1/06/1986\", Int64.Type}, {\"1/06/1987\", Int64.Type}, {\"1/06/1988\", Int64.Type}, {\"1/06/1989\", Int64.Type}, {\"1/06/1990\", Int64.Type}, {\"1/06/1991\", Int64.Type}, {\"1/06/1992\", Int64.Type}, {\"1/06/1993\", Int64.Type}, {\"1/06/1994\", Int64.Type}, {\"1/06/1995\", Int64.Type}, {\"1/06/1996\", Int64.Type}, {\"1/06/1997\", Int64.Type}, {\"1/06/1998\", Int64.Type}, {\"1/06/1999\", Int64.Type}, {\"1/06/2000\", Int64.Type}, {\"1/06/2001\", Int64.Type}, {\"1/06/2002\", Int64.Type}, {\"1/06/2003\", Int64.Type}, {\"1/06/2004\", Int64.Type}, {\"1/06/2005\", Int64.Type}, {\"1/06/2006\", Int64.Type}, {\"1/06/2007\", Int64.Type}, {\"1/06/2008\", Int64.Type}, {\"1/06/2009\", Int64.Type}, {\"1/06/2010\", Int64.Type}, {\"1/06/2011\", Int64.Type}, {\"1/06/2012\", Int64.Type}, {\"1/06/2013\", Int64.Type}, {\"1/06/2014\", Int64.Type}, {\"1/06/2015\", Int64.Type}, {\"1/06/2016\", Int64.Type}, {\"1/06/2017\", Int64.Type}, {\"1/06/2018\", Int64.Type}, {\"1/06/2019\", Int64.Type}, {\"1/06/2020\", Int64.Type}}),\n #\"Renamed Columns\" = Table.RenameColumns(#\"Changed Type\",{{\"Column1\", \"Series\"}}),\n #\"Unpivoted Other Columns\" = Table.UnpivotOtherColumns(#\"Renamed Columns\", {\"Series\", \"Unit\", \"Series Type\", \"Data Type\", \"Frequency\", \"Collection Month\", \"Series Start\", \"Series End\", \"No. Obs\", \"Series ID\"}, \"Attribute\", \"Value\"),\n #\"Renamed Columns1\" = Table.RenameColumns(#\"Unpivoted Other Columns\",{{\"Attribute\", \"Date\"}}),\n #\"Changed Type1\" = Table.TransformColumnTypes(#\"Renamed Columns1\",{{\"Date\", type date}})\nin\n #\"Changed Type1\"\r\nin\r\n Source;\r\nshared #\"Sample File (2)\" = let\r\n Source = Folder.Files(\"C:\\Dev\\ABS\\Population\"),\r\n #\"Filtered Name\" = Table.SelectRows(Source, each Text.StartsWith([Name], \"ABS Population - \")),\r\n #\"Filtered Extension\" = Table.SelectRows(#\"Filtered Name\", each [Extension] = \".xlsx\"),\r\n Navigation1 = #\"Filtered Extension\"{0}[Content]\r\nin\r\n Navigation1;\r\n"},"annotations":[{"name":"pbi:QueryGroups","value":"[]"}],"entities":[{"$type":"LocalEntity","name":"Population","description":"","pbi:refreshPolicy":{"$type":"FullRefreshPolicy","location":"Population.csv"},"attributes":[{"name":"Source.Name","dataType":"string"},{"name":"Series","dataType":"string"},{"name":"Unit","dataType":"string"},{"name":"Series Type","dataType":"string"},{"name":"Data Type","dataType":"string"},{"name":"Frequency","dataType":"string"},{"name":"Collection Month","dataType":"string"},{"name":"Series Start","dataType":"string"},{"name":"Series End","dataType":"string"},{"name":"No. Obs","dataType":"string"},{"name":"Series ID","dataType":"string"},{"name":"Date","dataType":"date"},{"name":"Value","dataType":"int64"},{"name":"Geography","dataType":"string"},{"name":"Gender","dataType":"string"},{"name":"Age","dataType":"int64"},{"name":"Age Category","dataType":"string"}],"partitions":[{"name":"Part001","refreshTime":"2021-05-30T01:11:55.918127+00:00","location":"https://wabiseaascdsa.blob.core.windows.net:443/b998efce-a4d0-4270-80cb-ac260ea248f1/Population.csv?snapshot=2021-05-30T01%3A11%3A55.9144885Z"}]}]}